2025-11-05 9:57 AM
Hello everyone I am new to the STM boards I had received my board today I had tried the basic LED toggle code and it is working fine but can someone please guide me to see the debug message on the code like I can see the printf statements how can I see those debug messages can someone please help me.
2025-11-05 10:30 AM
Welcome to the forum.
Please see How to write your question to maximize your chances to find a solution for best results.
@Mathan-Mukesh wrote:Hello everyone I am new to the STM boards .
Do you have experience with any other microcontrollers? With programming in general?
@Mathan-Mukesh wrote:I had tried the basic LED toggle code and it is working fine
Was that using an example from CubeIDE?
@Mathan-Mukesh wrote:to see the debug message on the code .
What debug messages?
@Mathan-Mukesh wrote:I can see the printf statements how can I see those debug messages
You mean you have put printf statements into your code?
printf is a standard C function which sends output to stdout.
On a "normal" platform like a PC, output to stdout will appear on the user's console - but an embedded system like a Nucleo board doesn't have such a thing.
So you have to decide where your stdout output will appear: you do that by writing suitable code - commonly to a UART.
Before getting involved in the complexities of printf and stdout, I would strongly suggest that you get basic UART output working using HAL_UART_Transmit:
At the end of that article, it will direct you to the next step - using that to get printf working to a UART.
2025-11-05 10:40 AM - edited 2025-11-05 10:40 AM
Hi @Mathan-Mukesh and welcome to the Community,
With the KB articles mentioned by @Andrew Neil , you can also refer to this AN4989 Application note STM32 microcontroller debug toolbox.