2024-04-22 08:35 AM - edited 2024-04-22 08:39 AM
It's the strangest, most frustrating thing I've encountered. I have three ST-LINK programmers; two /V2 and one /V3. All have been working fine for a good long time.
Today, CubeIDE won't program my device anymore, through any of the three programmers. Invariably, the debug console contains the following messages:
STMicroelectronics ST-LINK GDB server. Version 7.5.0
Copyright (c) 2023, 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
InitWhile : Enabled
Failed to bind to port 61235, error code -1: No error
Failure starting SWV server on TCP port: 61235
Failed to bind to port 61234, error code -1: No error
Failure starting GDB server: TCP port 61234 not available.
Shutting down...
Exit.
The "Problem Occurred" dialog appears, and the following is visible upon clicking "Details >>"
Error in final launch sequence:
Failed to start GDB server
Failed to start GDB server
Error in initializing ST-LINK device.
Reason: (0) Unknown. Please check power and cabling to target.
Bizarrely, CubeProgrammer can communicate with the target just fine, aside from this warning that appears in the log:
11:27:02 : Warning: Connection to AP 0 requested and Failed, Connection established with AP 1
I have Segger's software suite installed as well, and they all claim "no probes connected via USB".
Notably, if the JTAG cable is disconnected, the Console text changes to:
STMicroelectronics ST-LINK GDB server. Version 7.5.0
Copyright (c) 2023, 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
InitWhile : Enabled
Target unknown MCU target
Error in initializing ST-LINK device.
Reason: Unknown MCU found on target.
...and the Problem Occurred Details changes to this:
Error in final launch sequence:
Failed to execute MI command:
target remote localhost:61234
Error message from debugger back end:
localhost:61234: Connection timed out.
Failed to execute MI command:
target remote localhost:61234
Error message from debugger back end:
localhost:61234: Connection timed out.
localhost:61234: Connection timed out.
J-Link just keeps saying no probes connected via USB.
This has happened across two prototypes of my project involving an STM32H563ZI microcontroller, and is a new issue as of this morning.
What's going on? More importantly, how do I fix it? I'm dead in the water if I can't debug my code.
2024-04-22 08:46 AM
Do the ST-Links appear in Device Manager?
2024-04-22 08:54 AM
Yes:
and I'll mention again that CubeProgrammer is able to communicate successfully with the target through all three ST-Links.
2024-04-22 08:55 AM
>>I'm dead in the water if I can't debug my code.
More than one way to sink a boat..
Per Andrew, can you see the ST-LINK in Device Manage. If you can attach via STM32 Cube Programmer. Confirm VTarget voltage, confirm you can connect to STM32 part.
Any chance you locked out the STM32H5? Or reconfigured or disabled PA13/PA14 pins?
Does connectivity change if you pull BOOT0 pin HIGH?
2024-04-22 08:56 AM
Can you Mass Erase the part in Cube Programmer?
2024-04-22 09:07 AM
Thank you everyone who has responded so far. Since it's kinda buried in the middle of the post and has been universally missed by all readers, I'll emphasize again:
CubeProgrammer can communicate with the target just fine.
Yes, the target voltage is in range. I can Mass Erase the chip. I can also read it, program it, and use all of the other features within CubeProgrammer. It's definitely just CubeIDE that's having a problem.
I've been ignoring a prompt to update within CubeIDE for a while, due to the general tendency of updates to break things that were working...I pulled the trigger and started the update, which is taking a long time. I'll be back with word on whether that fixed anything.
It's just so strange that this started today, after everything had been working fine.
2024-04-22 01:40 PM
Update:
I applied all the software updates. No change.
After blindly unplugging and replugging lots of things lots of times, eventually I've found my way back to being able to debug in the IDE.
However...
On each[1] launch, I'm prompted to update the firmware in the ST-Link. If I choose to go ahead with the update, first I have to cycle power on the ST-Link to get it into "DFU Mode"...then another click of "Open in update mode" results in the following error displayed at the bottom of the STLinkUpgrade window:
"Unexpected flash size for ST-Link micro. Don't know how to upgrade."
Once again, CubeProgrammer has no such issue although I guess it didn't get updated, because it only offers an older version of the ST-Link firmware (V2J39S7 vs V2J49S7).
What in the wide world of almost-sports is going on here? Why does CubeIDE's STLinkUpgrade think my ST-Link has an unexpected flash size?
[1] - because I don't clear the "Always check for latest version" box.
2024-04-22 01:52 PM
Sorry not an active user of CubeIDE, #TeamKeil
Various releases of Cube Programmer have different versions of firmware for the ST-LINK's and it's usually possible to go back and forth a few versions.
2024-04-22 05:13 PM
It looks like someone at ST has broken the ST-Link. see
I had to roll back the Cube to version 1.14 to get it to work, and find some sanity...
I haven't heard anything from ST if they are going to address it...
Kind regards
Pedro