pyocd / pyOCD

Open source Python library for programming and debugging Arm Cortex-M microcontrollers
https://pyocd.io
Apache License 2.0
1.13k stars 484 forks source link

No output for SWV/SWO #1686

Open readmodifywrite opened 7 months ago

readmodifywrite commented 7 months ago

PyOCD 0.36.0 STM32F334

I'm trying to get SWV output and so far I'm getting no output. I have semihosting and SWV set up in my firmware and the SWV output is working in STM32CubeIDE.

The CubeIDE support is fine for interactive debugging, but what I really need is to get SWV output into an automated test system, and was hoping PyOCD could enable this.

Here's my setup:

PyOCD:

pyocd gdb -S -Oenable_swv=1 -Oswv_system_clock=80000000 -Oswv_clock=2000000 -Osemihost_console_type=console

My clock settings are correct, they match my working Cube config.

Then I run GDB:

arm-none-eabi-gdb -ex "target remote localhost:3333" -ex "monitor reset halt" -ex "monitor arm semihosting enable" -ex 'continue

No SWV output to console. I have tried Telnet to port 3443 (SWV raw server), no output there. I have also tried the telnet option for semihost_console_type, no output there either.

Anything else I can try? I don't know if this is a bug or maybe I just missed something in the docs? I went through several times but maybe I missed a config option or something.

readmodifywrite commented 7 months ago

Update:

I switched to semihosting only, and that does work on the telnet port 4444 and the console.

So, something is specifically wrong with SWV. I can live with semihosting, but if there's anything you'd like me to try for SWV, let me know.