Skip to main content
CTapp.1
Senior III
March 12, 2025
Solved

Capturing SWV data stream from GDB

  • March 12, 2025
  • 1 reply
  • 514 views

I've got SWV output showing within the STM32CubeIDE. I would now like to be able to capture this output from the command line using gdb. Is there any documentation on how to activate the SWV in gdb?

I've tried using:

 

monitor swo enable 4500000 decode 0

 

But that just gets "Protocol error with Rcmd".

Best answer by CTapp.1

Finally worked out that the SWV is streamed over IP from the GDB Server, and I needed to add some options to it's command line to enable it. Something like:

--swo-port 2332 --cpu-clock 150000000 --swo-clock-div 75

 Then a bit of Python to capture the stream - though I've not yet found any documentation that explains the data format.

1 reply

CTapp.1
CTapp.1AuthorBest answer
Senior III
March 20, 2025

Finally worked out that the SWV is streamed over IP from the GDB Server, and I needed to add some options to it's command line to enable it. Something like:

--swo-port 2332 --cpu-clock 150000000 --swo-clock-div 75

 Then a bit of Python to capture the stream - though I've not yet found any documentation that explains the data format.

All posts are made in a personal capacityMISRA C++ ChairMISRA C WG MemberDirector The MISRA Consortium Limited (TMCL)