cancel
Showing results for 
Search instead for 
Did you mean: 

SWV ITM (printf) - sometimes works, sometimes not

Tobe
Senior III

Hi,

i got quite some difficulties, having this run in a reliable way on a NUCLEO G431KBT6.

It more often does not work, as it would work. It often just wouldnt print anything (But it had before, without issues!). Sometimes the swv debugger couldnt be enabled on debugger start, or the arm-none-eabi*.exe crashed. (i did not made a screenshot - foolish me).

Anyone has some experience with this and could give me some tipps?

 

Edit:
The red record button behaves a little strange: It wont turn off sometimes, but when clicked, it wont turn on. But after having opened the settings, it is turned on.

8 REPLIES 8
AScha.3
Chief III

Hi,

just from your shown settings: you have to enable SWV (and set: real core clock ) to use it...

AScha3_0-1730022820437.png

 

If you feel a post has answered your question, please click "Accept as Solution".

I have. I accidently switched the configuration. I have reuploaded it.

STea
ST Employee

Hello @Tobe ,

Could you take a look at this article which may help you with your issue.

Also, could you mention the CubeIDE version which gives you this described behavior.
Regards

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi,

what part of this article could be helpful? Its not that detailed.

Version: 1.12.0
Build: 14980_20230301_1550 (UTC)

Hello @Tobe ,

the part that could be helpful is the part related to the configuration and enabling of SWV if you are having issues with that.

also, I would recommend you use the latest version of CubeIDE  v1.16.1 STM32CubeIDE - Integrated Development Environment for STM32 - STMicroelectronics 
as lots of fixes related to plugins such as SWV have been made. From my side the feature works fine on the latest version of CubeIDE.
Regards

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I am very hesitant to update programs, if they are working (at least enough for me;-) ).

Too many things are made worse than the were before.

 

BTW. It would be nice, if the forum gets an update, so there wouldnt be empty lines added after each edit of a post...

>>BTW. It would be nice, if the forum gets an update, so there wouldnt be empty lines added after each edit of a post...

I don't hold out much hope, this issue has been flagged for ages.

Trim out the excess when editing, so when you edit three times it doesn't keep expanding

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

Is it more robust/predictable if you use SWV pane in STM32 Cube Programmer?

The clock gearing of core vs debug needs to be synchronous. Watch ST-LINK/V3 not having MCO clock correct, depending on implementation/settings 8 MHz vs 8.333 MHz. SWO baud rate should be reasonably tolerant, but SWCLK going a lot faster on V3's, buffering of SWO/SWV perhaps an issue.

Perhaps buffer and use a slack UART for diagnostics. Or be able to switch into diagnostic vs normal mode via NUCLEO VCP.

SWCLK = USART2_TX

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