2025-12-03 9:39 AM
Hello,
I've been struggling with this issue for a couple days, I have a Nucleo-L476RG board that I am trying to run and debug in VS Code.
I'm using the STM32CubeMX + STM32 VS Code Extension tool chain to create cmake files, build, and then debug, but I cannot run and debug code due to an error:
Error in initializing ST-LINK device.
Reason: ST-LINK firmware upgrade required. Please upgrade the ST-LINK firmware using the upgrade tool.
I have tried using the "Upgrade ST-Link Firmware" button in the VS Code Extension "STM32Cube Devices and Boards Menu" and I get the following error:
Fatal error while trying to update STLink Firmware. Source: STM32Cube Debug Core
So I installed STM32CubeProgrammer and tried to upgrade firmware from there. I get the following information about my device:
Serial Number: 066AFF485671664867215448
Firmware Version: V2J43M28
When I select the "Firmware Upgrade" button, it says
Device 066AFF485671664867215448 not found. No device connected.
So I downloaded the STSW-LINK007 software, and tried to run ST-LinkUpgrade.exe for Windows. When I select "Device Connect" I get the following error:
No ST-Link found after GoToUsbLoader commend. Wait for the end of USB enumeration then try again.
I am at the end of my troubleshooting abilities. Is there something really obvious I am missing here?
Solved! Go to Solution.
2025-12-03 1:14 PM
try to excluse hardware issues:
- try another USB cable
- try another USB port
- avoid hubs
- if possible, try another host
hth
KnarfB
2025-12-03 1:14 PM
try to excluse hardware issues:
- try another USB cable
- try another USB port
- avoid hubs
- if possible, try another host
hth
KnarfB
2025-12-03 3:15 PM
I just installed STM32CubeProgrammer on a different PC and had the same error when I tried to upgrade firmware. Unfortunately I don't have another USB Mini B cable but a new one should be delivered Friday so I can test it out
2025-12-03 9:10 PM
Hello @sloops
Verify power pins and SWD connections.
Is it a genuine ST-Link? How to recognize a genuine ST-LINK/V2 versus a cloned one
Please refer to the article that may help you: How to solve connection errors when connecting and programming the STM32 target board
2025-12-04 10:14 AM
I'm using a Nucleo board with the integrated ST Link instead of a dedicated ST Link device. Not sure if there are Nucleo board clones but this one seems genuine?
2025-12-04 4:32 PM
The connection is somewhat finicky with older ST-links unfortunately. I'm sure the board is fine. This is USB FS, so I doubt the cable is at fault. Try different ports and add/remove hubs as others have mentioned. Probably you can find a working combination.
If I connect my board through a hub, I see this problem. Without the hub, it works as expected.
There was also a thread where someone from ST mentioned the STM32F1 USB DFU was not robust with higher speed hubs. That may be at play here. I can't find this thread.
2025-12-08 1:08 PM
Update - I finally received the new USB cable today and it fixed the issue. Thanks everyone!