Showing results for 
Search instead for 
Did you mean: 

Printf stop working after some time



After few successful printing using printf and the SWV ITM data console, the console stops showing new data. 

To recreate, I created new project, selected the device I have (STM32H723ZGT6), followed the instructions to enable debugging via printf/SWV ITM and run a sample program that just print every 100msec.

As you can see in the screenshot, the prints halt after 360 lines, although the program still runs and I can place an interrupt and see the program and the counter still progress correctly.

Any idea what can cause the printf to stop working?




I'm having the same problem with an STM32H745 Discovery board.  It will print to the data console for about 15 to 20 seconds and then I have to terminate the debug session and restart it before it will work again.  When I step through the _write() function, I see ITM_SendChar() is still being called for each character.  I also verified the ITM registers aren't changing (TER, TPR, TCR, LAR, LSR, PID*, CID*) from when it works to when it quits working.

@jking Try another host software that displays ITM output. CubeProgrammer, or the CubeIDE debugger with OpenOCD backend ?


Thanks for the suggestion, but I gave up on it because it wasn't going to be my long term solution anyway.  I assigned the output to a serial port on the dev kit instead of the ITM output and haven't had any problems since.