Open josesimoes opened 7 years ago
@robotdad Do you know anything about this?
@josesimoes do you have an example of how you're using this from the CLI? Are you using ST Link or something else?
Hi Mark!
I'm currently using STLink to get the SWO. Unfortunately one can't have both STLink and VSCode connected in the same debug session... I believe OpenOCD outputs this on a separate stream so it might be something as simple as grabbing that and forward it to the VS Code debug window...
It would be nice with support for SEGGER JLink as well. Don't know about OpenOCD, but JLink opens this on a port and you can use telnet to get the output.
JLinkGDBServer -if swd -device devicename
telnet localhost 2333
Of course, this can be done by opening a new terminal in VSC, but it would be nice if it was integrated.
Was wondering if this has had any progresses... 😉
Any progress on this
I recently found the Cortex-Debug extension, which I’ve found useful. It slows you to read registers (from an SVD file) and says it supports SWO, although I haven’t been able to get it to work.
wanted to keep this alive: any progress or plans for looking into this?
We haven't had time to look into this. I'll mark it "help wanted" to see if anyone would like to contribute.
This is very niche, just use a 3rd party tool.
There is this utility there might also be an addon for it, no need to put this into cpptools, so I vote for no fix and close it.
@mrx23dot ST-Link Utility (which I'm aware of and was referred to on a previous comment) has been deprecated by ST a long time ago. The replacement tool doesn't have this feature.
As I've mentioned also in a previous comment, one can't have at the same time a VS Code debug session and a connection to ST Link (or any other tool that uses SWO). Thus the original request to add this feature by tapping into OpenOCD which exposes SWO output.
There is an openocd command to get the stream https://stackoverflow.com/questions/50075076/show-cortex-m4-swo-log-with-openocd
Others said on stackoverflow:
using OpenOCD successfully for SWO capture with an STM32F7 platform: I've had to add gdb events to my .cfg file to force the itm port to initialize and flush consistently ... using the folllowing:
$_TARGETNAME configure -event gdb-detach { itm port 0 off; itm port 1
off; reset; shutdown }
$_TARGETNAME configure -event gdb-attach
{adapter_khz 4000; itm port 0 on; itm port 1 on}
Personally, I try to avoid SWO as much as possible, UART is better if you can afford it.
It seems that OpenOCD has added support for ARM SWO trace port. Would be truly awesome if cpptools could add support for this and be able to output that to the debug console!