cancel
Showing results for 
Search instead for 
Did you mean: 

I'm using a STM32F407ZG. When we use printf, it goes where?

JPell.2
Associate
 
3 REPLIES 3

In GNU/GCC as implemented via ST _write() then __io_putchar() to the UART you've created/enabled to output the data

In Keil the plumbing is slightly different, but the overall method is to sink characters and output them via a channel you opt to use.

They can go to HAL_UART_Transmit() or ITM_SendChar(), or both. Or whatever equivalent bare-metal or library you utilize.

https://community.st.com/s/article/how-to-redirect-the-printf-function-to-a-uart-for-debug-messages

https://community.st.com/s/question/0D50X0000BNLT7RSQX/role-of-syscallsc

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

If I didn't use any UART or If it's not redirected, I suppose it goes nowhere, right?

Or traps in a BKPT..

Some of this might be evident with some debugging, and code walking. You could look at a disassembly, perhaps .MAP symbols.

Not much to work with here, your description of the system and build tools, pretty vague.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..