Skip to main content
ADabl.1
Associate II
November 26, 2021
Question

Failed to start GDB server Error in initialising ST-Link device

  • November 26, 2021
  • 6 replies
  • 62990 views

Hello folks,

I am new to STM32 and have been using it (STM32H7A3ZIQ) for a while, everything was fine with download and debugging codes until a week ago when STM32CubeIDE suddenly has stopped launching the debug session. An error msg -failed to start GDB server (see attached) pops out whenever I want to debug codes, I have been trying to resolve this very problem for the past week by following other people's solutions on Youtube, but all my attempts were in vain.

In addition, I installed different ST-Link programs provided by ST such that ST-Link server (Utility), STSW 004, 007, and 009. But even by doing so, I couldn't resolve this matter and no device found remains.

NB:

  • Even after having updated my device (V3.J8.M3) by using ST-Link 007, STM32CubeIDE doesn't recognise it at all (no device found on target).
  • ST-Link utility also cannot connect to the target

I hope someone could help me to get back coding.

I look forward to hearing your expert thoughts on how to resolve it.

BR,

AD

6 replies

moatjon
Associate II
November 26, 2021

Hey AD,

Are you using a Nucleo board? If so, are the headers/jumpers on the Nucleo fitted correctly? The error message suggests that the ST-Link itself can be detected, but that the target itself is not found. Perhaps you can use the multimeter to check if both the ST-Link and the target chip are supplied with a proper VCC.

You mention you have used different ST-Link programs, have you also tried STM32CubeProgrammer? If not, you can try updating your ST-Link firmware through STM32CubeProgrammer. If STM32CubeProgrammer does detect your target chip, you can select the flashable binary output of your build folder and flash the chip manually through STM32CubeProgrammer.

I have had situations where STM32CubeIde did not detect my chip, while STM32CubeProgrammer did. If that's the case, a system restart usually solved the problem for me. You can also try using OpenOCD (Run>Debug Configurations>"Debugger" tab>Debug Probe).

I hope this helps.

Kind regards,

moatjon

ADabl.1
ADabl.1Author
Associate II
November 26, 2021

Hi Moatjon,

Thanks for replying!

Yes indeed, I am using Nucleo-board. The first thing I certainly did was inspect jumpers ( JP4 set to VDD, JP5 set to VDD 3.3 v, and JP2 set to STLink). Once the device is connected LED5 lights on.

Have a look at Image5 -STM32CubePro, the device is recognised only by its serial number, target voltage, and firmware version but when clicking on CONNECT a msg pops out saying that no STM32 target was found. (of course, one can realise that there is no target info, but why? I frankly have no clue) and I have found it a bit odd that only the serial number is detected.

*U mentioned the selection of the flashable binary output, how can I manage to do it... I couldn't find such a feature anywhere.

** On OpenOCD... image6 can support u with the configuration run.

hope this walks you through my problem.

BR,

AD

ADabl.1
ADabl.1Author
Associate II
November 26, 2021

Image5

JDIVO.1
ST Employee
March 11, 2023

For those facing the error, but on different boards : it might be a problem with trustzone enabled.

You can look at the option byte TZEN in CubeProgrammer to check if trustzone is enabled or not.

The Getting started pdf guide of the package explains in the FAQ how you can disable trustzone.

Associate
January 29, 2024

I have the same problem.the solution is to use STM32Programmer.to detect it you put the Shared tab on Enable.once that , you hold down the reset , and once it is trying to connect you release it.so you get it to connect.to finish , you delete the flash, and ready.
I have the same problem, what happens is that I don't know how to solve it, every time I load the program, it loads fine, the PCB works, but the GDB stops detecting it.

Visitor II
April 13, 2024

I began having the "failed to start GDB server" error after changing the version of STM32CudeIDE. The solution was to create a new Debug launch configuration using these steps.

Run > Debug Configurations... > New Launch Configuration*

* New Launch Configuration is the icon on the left of the Debug Configurations dialog window.

It may be necessary to copy some of the settings from a previously working launch configuration into the new one.

Visitor II
June 6, 2024

Hello ADabl.1,

I understand your frustration with the STM32CubeIDE not launching the debug session and the issues with the ST-Link connection. I experienced a similar problem recently with my STM32F401CCU6, and I found a solution that worked for me.

Solution:

The key was to press both the RESET and BOOT0 buttons on the MCU during the programming and debugging process. Here's the step-by-step procedure that resolved my issue:

  1. Connect Your STM32 to Your Computer: Ensure your STM32 board is connected to your computer via USB.
  2. Set BOOT0 to High: Press and hold the BOOT0 button. This puts the microcontroller into system memory boot mode, allowing it to enter the built-in bootloader.
  3. Press RESET: While holding the BOOT0 button, press the RESET button on the MCU. This action resets the microcontroller and ensures it starts in bootloader mode.
  4. Release RESET: Release the RESET button while still holding BOOT0.
  5. Release BOOT0: After a few seconds, release the BOOT0 button. This sequence ensures that the microcontroller enters a state where it can be reprogrammed and debugged.
  6. Start Debugging in STM32CubeIDE: Open STM32CubeIDE and attempt to start the debug session again.

Additional Tips:

  • Update Firmware: Ensure your ST-Link firmware is up to date. You've already updated to V3.J8.M3, which is good.
  • Check Connections: Double-check all connections between your ST-Link programmer and the MCU. Loose connections can often cause issues.
  • Try Different USB Ports/Cables: Sometimes, the issue might be with the USB port or cable, so try different ones if possible.
  • Reinstall STM32CubeIDE and ST-Link Utilities: As a last resort, uninstall and reinstall the STM32CubeIDE and ST-Link utilities.

After following these steps, my STM32CubeIDE successfully recognized the device, and I was able to debug my codes without any issues.

I hope this solution works for you as well. Please let me know if you need any further assistance.

Best regards, 
Navaneethan.


 

Explorer
December 21, 2024

 

Dear Navaneethan, 

 

Thank you for providing the detailed steps, I had a similar issue with STM32F429I Discovery Board and it worked for me. 

 

Best regards,

Ebrahim 

 

 

Visitor II
September 8, 2025

Hello everyone,

I was getting Failed to start GDB server Failed to start GDB server Error in initializing ST-LINK device. Reason: (2) ST-LINK DLL error.; errors.I solved these. Hopefully, it works for everyone.

First, I will mention the hardware. I am using the Nucleo-F411RE board. I bought it in August 2025. I am not sure if it is original or not. To solve these errors, I watched many videos and read numerous comments and articles. In the end, I managed to solve it with my own attempt.

Required programs:

  • ST-LINK Utility

  • STM32CubeIDE

Finish downloading and complete the installations.

STEP 1 :

Run ST-Link utility. Then connect stm32 board to your computer's.


STEP 2 :

Click on the ST-LINK tab in the ST-LINK Utility. Then, click on the Firmware update option.

STEP 3 :

Click on the Device Connect then click on the "Yes >>>" button.

After the installation is complete, remove your STM32 board and reconnect it to your computer. You are done with the ST-LINK Utility, so you can close it. Then, open the STM32CubeIDE program. When you try to run a debug session, it will notify you that an update is available. Perform the update. After that, remove and reconnect the board again. To confirm that your issue is resolved, try debugging once more.

This worked for me.