Skip to main content
Explorer
August 27, 2024
Solved

Error whilst trying to update STLink Firmware

  • August 27, 2024
  • 3 replies
  • 5468 views

 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.

    This topic has been closed for replies.
    Best answer by Cartu38 OpenDev

    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

     

     

     

    3 replies

    Explorer
    September 19, 2024

    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

    Explorer
    September 19, 2024

    hi @mlnslm. thank you, it worked!

    Visitor II
    September 9, 2025

    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 .
     
    Graduate II
    September 14, 2025

    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