Skip to main content
CTapp.1
Senior III
Mar 12, 2025 7:47 PM UTC
Solved

Capturing SWV data stream from GDB

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".

This topic has been closed for replies.
CTapp.1
CTapp.1Best answer
Senior III
Mar 20, 2025 11:08 AM UTC

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 capacity. MISRA C++ Chair, MISRA C WG Member, Director The MISRA Consortium Limited (TMCL)

1 reply

CTapp.1
CTapp.1AuthorBest answer
Senior III
Mar 20, 2025 11:08 AM UTC

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 capacity. MISRA C++ Chair, MISRA C WG Member, Director The MISRA Consortium Limited (TMCL)