cancel
Showing results for 
Search instead for 
Did you mean: 

Error whilst trying to update STLink Firmware

mqasemipur
Associate

 I am using an ST-Link V2 for debugging in VS Code. It worked before, but now it gives me an error in the GDB server terminal:

"Error in initializing ST-LINK device.
Reason: ST-LINK firmware upgrade required. Please upgrade the ST-LINK firmware using the upgrade tool."

mqasemipur_0-1724768422373.png

When I try to upgrade my ST-Link firmware version using the button in the VS Code STM32 extension, this error is displayed: "Error whilst trying to update STLink Firmware."

mqasemipur_0-1724767268468.png

Even when the ST-Link is disconnected, this error is still displayed.I tried to upgrade it with the ST-Link utility, and it tells me the upgrade is successful, but nothing changed, and I still have these errors.

1 ACCEPTED SOLUTION

Accepted Solutions
Cartu38 OpenDev
Lead III

If I may, sounds you're relying on versions <3.0.0 while some new pre-release versions >3.0.0 are available see https://community.st.com/t5/stm32cube-for-visual-studio-code/new-stm32cube-for-visual-studio-code-extenstion-released-3-5-1/td-p/819484

STLink firmware update experience is according to me much better embracing fresh material

Cartu38OpenDev_0-1757832963891.png

 

 

 

View solution in original post

4 REPLIES 4
mlnslm
Associate

Hello mqasemipur

At least for me on Windows 11, the command 

 

stlinkupgrade

 

typed in a Terminal worked. If the command is not found, it is essentially a .bat script in the STM32CubeCLT base directory, by default at

 

C:\ST\STM32CubeCLT

 

Naturally this does not fix the issue of the extension, which I also got on multiple machines.

Best regards

hi @mlnslm. thank you, it worked!

tx
Associate

The "Upgrade ST Link firmware" button in PROJECT MANAGER will ultimately run the CubeCLT's "STLinkUpgrade.bat" in this way:

 

let c = (0, yu.spawn)("STLinkUpgrade.bat", { env: { PATH: a } });
 
It's not right to use "spawn" in this way in windows, because windows needs a "shell" to run a ".bat" file.
The right way is:
 
let c = (0, yu.spawn)("STLinkUpgrade.bat",
   { env: { PATH: a },  shell: process.platform === 'win32' });
 
This sentence is in the .vscode\extensions\stmicroelectronics.stm32-vscode-extension-x.x.x\out\extensions.js file.
Or you can just typy in the stlinkupgrade directly in command line to do the upgrade, as said by @mlnslm .
 
Cartu38 OpenDev
Lead III

If I may, sounds you're relying on versions <3.0.0 while some new pre-release versions >3.0.0 are available see https://community.st.com/t5/stm32cube-for-visual-studio-code/new-stm32cube-for-visual-studio-code-extenstion-released-3-5-1/td-p/819484

STLink firmware update experience is according to me much better embracing fresh material

Cartu38OpenDev_0-1757832963891.png