cancel
Showing results for 
Search instead for 
Did you mean: 

Debug with SWO and SWV in STM32CubeIDE 1.3.0

PHlin.1
Associate III

Hello,

Is there any guide or manual how to use SWO and SWV in STM32CubeIDE? I found many discussions about this topic, but most of them were outdated or newer resolved.

I believe that one part is to enabled SWV in debug settings, set the CPU and SWO clock (160Mhz and 2000kHz in my case) and in the second step during the debug session I have to enable ITM Stimulus port 0 in SWV configuration and start it with Start trace button in SWV window, is that all?

This somehow worked in STM32CubeIDE 1.2.0 even that printf using ITM_SendChar(ch) didn't work form me, but when I click on Start trace button in SWV window in 1.3.0 during debug session, I'm getting "Target is not responding, retrying..." error messages and whole debug session shuts down. This wasn't happening in previous version.

Could somebody please help me with this? I already spend quite a lot of time without any luck.

Thanks,

Petr

14 REPLIES 14
Pavel A.
Evangelist III

Does your STM32 model support ITM? Cortex M0's do not have it.

Otherwise, enabling debug prints should work as you've described.

Also, Cube IDE 1.3 seems to have major problems with debugger - see here, here.

-- pa

PHlin.1
Associate III

Thanks for your reply Pavel,

I'm using STM32H7A3 and nucleo development board. In that first link the user has problem using debugger at all, in my case debugging works fine until I start the SWV, than whole debug session shut down with that error messages.

KnarfB
Principal III

Don't have a H7 but it works on my Nucleo-F446RE using STM32CubeIDE 1.3.0 Build: 5720_20200220_1053 (UTC) on Win10.

Had issues with STLINK stability recently before updating my boards to the latest (V2J36M26) STLINK firmware.

Pavel A.
Evangelist III

> in my case debugging works fine until I start the SWV, than whole debug session shut down with that error messages.

I've seen similar errors with CubeIDE 1.2 and some chinese H750 boards that do not have built-in ST-LINK.

Wired up a ST-LINK v2 dongle to them. Because I'm horrible solder, quality was bad and I think this was reason of the errors.

Check the voltages and so on. Maybe, firmware version of ST-LINK also matters. Debugging is more stable with Atollic, try that.

-- pa

papamidas
Associate II

I have exactly the same problem with my NUCLEO_H743ZI.

As soon as I press the red button "start trace" in my STM32CUBEIDE 1.3.0 SWV ITM Data Console the following happens:

Target is not responding, retrying...

Target is not responding, retrying...

Target is not responding, retrying...

Target is not responding, retrying...

Target is not responding, retrying...

Target is not responding, retrying...

Target is not responding, retrying...

Target is not responding, retrying...

Target is not responding, retrying...

Target is not responding, retrying...

Debugger connection lost.

Shutting down...

Any ideas?

BGrab.1
Associate

That's weird. I had this working on NUCLEO_H743ZI (the one with stlink v3) fine. And suddenly it just stopped working with "Target is not responding, retrying..." after clicking "start trace". I've upgraded to 1.3.1 and still the same issue - restarting, reconnecting and such doesn't seem to help. I'll try on a diffrent machine tomorrow, I hope that it'll work.

This is exactly what bugs me in CubeIDE. Debugger works fine, then oops and it fails for no clear reason.

-- pa

Nope, different machine doesn't work. It's real shame that ST decided to not collaborate with Segger on stlink v3, so that their powerful hardware with terrible software can be replaced by J-link which is *much* better and stable.

See here: https://forum.segger.com/index.php/Thread/6618-SOLVED-ST-Link-Reflash-Utility-for-ST-LINK-V3E/?postID=24318#post24318

Has anyone had any luck with this? I have the same board (NUCLEO H743ZI) and am unable to start a trace on the SWV console.