cancel
Showing results for 
Search instead for 
Did you mean: 

Segger GDBServer (SWV tracing) stopped working after J-Link FW upgrade

eBirdman
Senior

I had a perfectly working setup:

Target STM32F411 , a probe Segger J-Link mini, GDBServer configured with SWV trace running at max speed over SWO wire, STM32CubeIDE and all it's "underwear" was upgraded to the latest (current) .

The only old version in the fully working system was the J-Link probe firmware.

As CubeIDE persisted in suggesting to upgrade that FW, I finally did that. After the upgrade the Debugger stopped working.

Specifically , it works only if I disable SWV functionality (SWO pin, ITM Cortex-M7 internal function) . When SWV is selected as before the upgrade with all the same configuration and hardware connection, then loading of target fails . The screenshot of the pop-up information provided by DGBServer is attached. The console debug window does not provided any more information and I cannot find option for DGBServer logs in the Debug configuration screen (I know where it was in the past but not any more).

Using the J-Link configurator I confirmed that the version of FW is the latest. Using J-Link commander I confirmed that the target is working fine . Only GDBServer in CubeIDE fails using J-Link probe to enable SWV configuration.

The linker script is the same previously working.

Please somebody suggest what could be broken after the upgrade?

6 REPLIES 6
eBirdman
Senior

Replaced the J-Link probe with another one which still using the older FW version (not upgraded) and run the same project, the same executable and all the same linker and debugger configuration and everything works as before.

So either current FW version (V7.60E) from Segger is buggy or the GDBServer configuration generated in CubeIDE is not working properly for a new FW version.

Does anybody else have this problem?

eBirdman
Senior

Did more research and I've got some clues to what might be a bug in the GDBserver configuration for a new J-Link firmware. I will share here my findings to those who are willing to find a fix but I can't spend time on this any more. I invalidated the new firmware in my J-Link probe and re-installed V7.00 which works and allows me to continue with my project.

----

Segger introduced this new "feature" to the J-Link probe firmware in their release notes for Version V7.22 (2021-06-01) which may not be satisfied by CubeIDE / GDBServer

(quoted from https://www.segger.com/downloads/jlink/ReleaseNotes_JLink.html , Version V7.22, highlight is mine) :

SWOViewer

  1. Added command line option "-swoattach <OnOff>" that disables all J-Link side initialization of SWO and relies on the target application to perform SWO init.

It is not clear to me whether J-Link probe's SWO gets configured anyhow if this option is not provided during the download to the target from GDBServer. The fact is that CubeIDE GDBServer does not have this option. Here is J-Link GDBServer CL options from the Debugger configuration window:

C:\STM\STM32CubeIDE_1.8.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.jlink.win32_2.0.100.202110251254\tools\bin\JLinkGDBServerCL.exe -port 2331 -s -device STM32F411CE -endian little -speed 4000 -if swd -swoport 2332 -vd

As you can see the -swoattach option is not there. How does the probe behave in this version? Probably fails to configure SWO which is SWV for the end user.

I will post this to the Segger forum too but they might just confirm my finding and the ball will stay in the STM CubeIDE/GDBServer configuration...

I hope that STM developers will want to look into this as I need to continue with my project.

Thanks to whoever takes this issue to solve.

Hello there!

It's definitely something we would want to look into. I'll run some tests to see if I can reproduce. In the meantime, let me know if you get any response from SEGGER.

eBirdman
Senior

Thank you Markus for taking this over. I will surely post here any reply from Segger but unfortunately so far (2 days after) no reply came although I know that they have read it. May be they are working on this issue.

This problem must be effecting all the users who use J-Link with SWV functionality with latest FW for the probe.

If I dared to upgrade one of my probes FW again , I'd add a initializing script with the mentioned option for the probe and see if SWO pin on the probe start working, but all my probes are engaged in the project - this is multi-MCU application, can't take a risk again , downgrading the FW is not a reliable task.

Will post whatever I get from Segger.

eBirdman
Senior

2 month since posting - nothing from Segger and nothing from this forum.

As STM32CubeIDE prompts to upgrade J-Link firmware with a new version every time the debugger is launched and I run the debugger a hundred times a day, I eventually pressed "yes" by accident and now it stopped working again. Need to go through that reset and reloading older version using Segger tools...

Am I the only one who is using STM32 MCU with Segger' J-link with SWO/SWV feature? Nobody else cares?

Hope to get it fixed soon

eBirdman
Senior

Is it possible to setup IDE so that it does not pop up window for the J-Link firmware upgrade?

If the fixing this firmware incompatibility with IDE is hard or impossible, then just preventing the accidental "yes" to upgrade can hide the problem for the time being ....

The setup option to do that or a hacking of IDE configuration file would do...