2020-01-13 08:11 PM
I am generating code using STM32CubeIDE, but when I start to debug I am getting errors like:
"STMicroelectronics ST-LINK GDB server. Version 5.2.3
Copyright (c) 2019, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
Waiting for debugger connection...
Debugger connected
Debugger connection lost.
Shutting down..."
I am using the latest version of st-link USB driver(en.stsw link009). Also I am using USB to TTL converter. Initially everything was working very well, near about ten code executed successfully. But now facing the above error. So how can I solve it?
Solved! Go to Solution.
2020-12-04 01:11 AM
We have seen issues with a few number of devices that the user is forced to perform a mass erase before being able to flash a new bianry. This is obviously a bug and we try to fix it for the next version. If you do run into this problem with CubeIDE and ST-LINK GDB server then you can try to add the following to force a mass erase before programming the new binary:
In your debug configuration > Startup tab > Initialization commands > Add: monitor flash mass_erase
This will force CubeProgrammer_CLI version to peform a mass erase before programming new content. At least it automates the procedure you describe @GNels.2 in your post above.
Other issues leading to debugger connection lost after the initial launch of your application typically includes:
2020-01-13 10:22 PM
Does you application use sleep mode ?
2020-01-17 02:05 AM
@Ozone thanks for your reply sir.My application not use sleep mode.
2020-01-17 02:28 AM
From the information provided, it looks like the target disconnects itself somewhere later in your application.
I don't use Cube. nor CubeIDE.
Have you tried to debug your application from the reset vector on ?
2020-01-17 03:21 AM
@Ozone thanks for your reply sir,there is not any reset vector option for debug in IDE.
2020-01-19 10:25 PM
I don't know your IDE.
Perhaps there is a debugger setting "Run to main".
Disable that, and your debugger will supposedly stop at the reset vector.
2020-01-21 09:16 PM
@Ozone ok,thank you sir.
2020-04-07 06:31 AM
I've been tinkering with this problem for two days. I expose before the clumsy attempts I made and in the end my solution.
I recompiled my app and its elf: failed. I upgraded st-link and STM32CubeProgrammer: failed. I changed some settings of elf debugger section: failed. Once I succeded, but the day after, on the same app the problem persisted: not viable. The last app could be debugged and its elf could be used by the other not debuggable apps: just an experiment. For sure the upgrading of some tools has been
a good thing, but doesn't solve the issue.
Then, with some fears about loosing my NUCLEO F446RE, as personal mobility is at present reduced,
I applied STM32CubeIDE ST-LINK GDB server UM2576 3 Troubleshooting pag 8:
If STM32CubeProgrammer can connect to the target, try to:
1. Erase the Flash with STM32CubeProgrammer.
That's it. Now I can re-program my old apps and their elf debug fine with GDB server.
2020-05-18 04:35 AM
hello did you found a solution ?
2020-06-03 05:47 AM
i dont know about him, but i am having the same problem and i can not find a solution yet