Skip to main content
PHlin.1
Associate III
March 2, 2020
Question

Debug with SWO and SWV in STM32CubeIDE 1.3.0

  • March 2, 2020
  • 8 replies
  • 7912 views

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

This topic has been closed for replies.

8 replies

Pavel A.
March 2, 2020

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
PHlin.1Author
Associate III
March 2, 2020

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
Super User
March 2, 2020

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.
March 3, 2020

> 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
April 11, 2020

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?

SChan.5
Visitor II
May 19, 2020

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.

Pavel A.
May 20, 2020

See this. V1.3.0 looks broken, go back to 1.2.

-- pa

BGrab.1
Visitor II
April 20, 2020

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.

Pavel A.
April 21, 2020

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

-- pa

MEdgerton
Associate III
June 21, 2020

Has anyone got the SWV console working reliably?

I read somewhere that someone updated the STlink-v3 firmware and had an option not to include mass storage device which worked. But I cannot find that option in the utility either in CubeIDE or the stand alone upgrade utility(which updates to a newer version than cubeIDE). Does anyone know where this firmware is to try?

Is anyone from ST reading this and can comment on when we my see a fix?

Or am I just going to have to get a UART hooked up and loose some pins for a basic debug output?

Thanks,

Mark

Pavel A.
June 21, 2020

It looks like one has to dig into OpenOCD internals to get things working reliably. But I never had time for this.

-- pa

MEdgerton
Associate III
June 22, 2020

This seems to only affect the H7 as all the other Nucleo board I have are fine. Or is it the STLink-V3 that is affected?

As you says its the OpenOCD is there a forum somewhere else this is being discussed as a general problem.

I thought it may just be an issue with some ST H7 devices/boards?

VSánc.1
Visitor II
December 4, 2021

I recommend you verify the frequency of the interface is the same as the HCLK