6 years, 9 months ago.

How to make printf work with the STM32F429I-DISCO Board

I have been able to get printf to work on the STM32F429!-DISCO version of the board using the STM32-Cube software to build a runtime library that I use with EmBitz v1.11 (which uses GCC). Here's what I did:

Maybe you can make it work in mbed? Here's what I did:

In file STM32Cube_FW_F4_V1.16.0\Utilities\Log\lcd_log.c:

  • Find the function whose function header is a macro named: LCD_LOG_PUTCHAR
  • Replace the macro name (the entire line) with: int Put1Char(int ch)
  • Add the following function to the same file:

int _write(int file, char *ptr, int len)
{
   int i;
   for (i = 0; i < len; i++)  Put1Char(*ptr++) ;
   return len ;
}

That's all it took!

Dan Lewis dlewis@scu.edu

Question relating to:

The STM32F429 Discovery kit (STM32F429I-DISC1) allows users to easily develop applications with the STM32F429 high-performance MCUs with ARM®Cortex®-M4 core.

2 Answers

5 years, 4 months ago.

Possible ff used external USB/TTL converter like FTDI and connect to UART.

6 years, 7 months ago.

STM32F429I-DISCO Board does NOT support printf, STM32F429I-DISC1 Board supports printf.