2020-10-24 05:02 AM
I am using SWV as my trace output on STM32F4 (STM32F437VG on a custom board and STM32F407 on a Discovery board). I need to be able to capture this output using command-line tools and into a text file or similar (on Windows 10) so that I can use it in my CI system. However I cannot get ST-LINK_gdbserver.exe to give me SWV output all of the time. Here are the data points:
ST-LINK_gdbserver.exe -d -a 168000000 -b 84 -p 61200 -z 61300
target remote localhost:61200
monitor reset
continue
Has anyone else seen issues of this nature, or can anyone suggest something else I could try? FYI I've tried using Open OCD but unfortunately that doesn't work in a different way (though SWV logging always starts reliably Open OCD fails to output the end of the trace buffer 50% of the time).
2020-11-03 09:27 AM
And the answer was... the different PC tools seem to be "differently sensitive" to character loss on the SWV interface. The STM32Cube IDE is very tolerant, the ST-Link utility mostly tolerant and ST-LINK_gdbserver.exe not tolerant at all. I've now switched back to Open OCD and bringing the SWV rate down from 2 MHz to 100 kHz gives me reliable operation; we have three board variants, one of which I need to use in development that has been solder-reflowed to mount a new component and I reckon this has degraded the SWV line rather a lot.
So, beware that the behaviour of PC-side tools can be "sensitive to grey" in terms of SWV, it's not a black and white thing as you (I) assume it might be.