2025-12-08 5:46 AM - last edited on 2025-12-08 6:44 AM by Andrew Neil
I am trying to use SWD for printing using ITM_Sendchar, Printf not calling _write, I tried to put breakpoint and see, But it is not hitting breakpoint
Solved! Go to Solution.
2025-12-10 6:49 AM
Clock speed needs to match.
Doesn't the STM32F3 have a default HSI of 8 MHz?
Use that speed.
Perhaps also output to the VCP USART so you can see in a Terminal app, and print out SystemCoreClock to confirm.
2025-12-08 6:12 AM
By default, stdout is line buffered. You will see output only after a newline '\n'. Less common: stdout buffering might be changed to unbuffered as well.
hth
KnarfB
2025-12-08 6:25 AM - edited 2025-12-08 6:31 AM
welcome to the forum.
Please see How to write your question to maximize your chances to find a solution - particularly how to post source code (not as images).
See also: How to insert source code
As @KnarfB said, stdout defaults to line-buffered, so you won't see any output until a newline is sent.
This is also noted in the Knowledgebase article, How to redirect the printf function to a UART for debug messages.
See also: https://community.st.com/t5/stm32-mcus/how-to-redirect-the-printf-function-to-a-uart-for-debug-messages/ta-p/49865#:~:text=5.2.%20Line%2Dbuffering,has%20been%20formed - which includes how to disable the line-buffering.
Also Try:
printf( "Hello World!\n" );instead...
2025-12-08 6:28 AM
I just came here to give update, So _write is called, But now Even though I enabled SWD, and trace, and Port 0, Print is not working
2025-12-08 7:08 AM
Board type? (If ST.) Schematic? (If your own.)
2025-12-08 7:12 AM
STM32 , NUCLEO-F303RE
2025-12-08 11:26 AM
Is the SWO pin configured in CubeMX?
2025-12-09 1:00 AM
Is SB15 fitted?
via: https://www.st.com/en/evaluation-tools/nucleo-f303re.html#documentation
2025-12-09 4:54 AM
I don't understand this, Could you please explain what exactly is the question?
2025-12-09 4:54 AM
How do I check this? any steps would be helpful