Skip to main content
MikeDB
Senior II
May 1, 2019
Question

STM32CubeIDE Cannot run program "gdb": Launching failed

  • May 1, 2019
  • 32 replies
  • 23917 views

I'm sure it's something silly and I can't believe I'm the only person who has seen this message but searching this site doesn't yield any clues. Can someone point me to what I am setting up wrong, presumably in the Debug Configuration menu ?

32 replies

MFick.1
Associate
January 20, 2020

After working a view days i experienced the gdb --version error this afternoon too. Deleting a debug/prjname.elf file in Debug Configuration // C/C++ Application solved the problem for me.

CMonr.1
Visitor II
January 26, 2020

Same problem!

I just installed STM32CubeIDE (Windows 10) and tried to blink an LED on a brand new Nucleo-64 board STM32F303RE.

You know, a simple test to make sure everything is working right. Ha well, funny thing is... it's not working.

I selected the Nucleo-F303RE board in the CubeMX configuration and followed the CubeIDE getting started video on youtube.

Everything is great until I click 'Debug'. That's when I get the "Error with command: gdb --version" message.

How do we fix this???

What I've tried:

In the Debug settings tab I changed "gdb" to point to the location of "ST-LINK-gdb-server.exe" that I found after searching for GDB in the CubeIDE install folder. But that didn't work.

I haven't found anything in the STM32CubeIDE install guide that says I need to install something else or change the debug configuration.

A help is greatly appreciated!

Thanks!

CMonr.1
Visitor II
January 26, 2020

It seemes I stumbled on a solution.

I went back and selected Project->Build Project

Then Run->Debug As->STM32 MCU C/C++ Application

A new window popped up asking me to make a new debug configuration. I selected 'Okay' without changing anything.

Then the IDE asked if I wanted to open the debug perspective and I selected 'Switch'.

Now debugging is active and stopped at the first line in my program waiting for me to proceed. :)

I think the problem was I had previously selected the wrong build option instead of 'Build Project'.

I hope this helps!

CWeng.1
Visitor II
January 30, 2020

I have the same issue too.

A month ago, I used NUCLEO to test some function and the program progress work success.

But few days ago, STM32CubeIDE suddenly can not execute program and pop-out the message below, and I have no idea how to solve this problem.

Error with command: gdb --version

Cannot run program "gdb": Launching failed

CWeng.1
Visitor II
January 30, 2020

I found the problem.

If you run the debug, you should check your debug configuration and use "STM32 Cortex-M C/C++ Application".

0690X00000BwvqsQAB.png

KnarfB
Super User
January 30, 2020

> Error with command: gdb --version

> Cannot run program "gdb": Launching failed

This is testing for presence of the debugger. The error message should read "debugger not found"

Be sure that your project/Debug Configuration is of type STM32 Cortex-M...

For every Debug configuration, there is a .launch file. Open it with a text editor. There is a line:

<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="${TOOLCHAIN_PATH}/arm-none-eabi-gdb"/>

Check that path.

You can edit the path to be the absolute path for the debugger.

On my Win10 PC it is

<stringAttribute key="org.eclipse.cdt.dsf.gdb.DEBUG_NAME" value="C:/ST/STM32CubeIDE_1.1.0/STM32CubeIDE/plugins/com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610/tools/bin/arm-none-eabi-gdb"/>

your mileage may vary.

Avoid complications in the path like space char's umlauts, etc.

Note: Couldn't figure out how to set/change ${TOOLCHAIN_PATH} in the GUI.

mattias norlander
ST Employee
January 31, 2020

Two things to check if you experience this problem:

  1. Are you using the right debug configuraiton type?
    1. Go to Run -> Debug configurations... The debug config (referred to as launch configuration in Eclipse world) must be of type "STM32 C/C++ Application". You should not have any configurations under the other nodes in the left-side panel. Well, maybe you have downloaded a PC toolchain to also make some x86/PC application in that case those would be launched with "C/C++ Application" configurations...
  2. We have historically seen quite some hungry anti-virus tools who thinks gdb looks tasty or sick?! As a result they eat/delete or quarantine the gdb client.
    1. Double-check that the file "arm-none-eabi-gdb.exe" still exists in your installation folder which would be something like here: C:\ST\STM32CubeIDE_1.2.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.7-2018-q2-update.win32_1.0.0.201904181610\tools\bin
    2. If you have this issue I am afraid that you may need to re-install and check the anti-virus tool so that it does not happen again. You can try to switch to the other toolchain to see if this gdb version still is available and able to debug the project: Project Properties -> C/C++ Build -> Settings -> Toolchain versions. Here change to Fixed and GNU ARM Embedded.

I hope this solves the issues for some of you.

CMonr.1
Visitor II
February 3, 2020

Thanks mattias for the detailed info!

That's very helpful to better understand what's going on.

S.Ma
Principal
February 1, 2020

Thanks for the input. Sometime I see such gdb fail message, click a source file in project, open it, and sometime recovers. Probably related to how eclipse guess the user's context? with 1.21k views, this topic seems of interest to users.

DHoyo
Visitor II
February 6, 2020

Hello, I get the same error, after change my debug configutation, it sems that it works... I don't know why... but works.

0690X00000D8EFhQAN.png

GOmon.1
Associate II
February 10, 2020

I agree . I have just come across the same problem, and cant seem to fix it.

I have even reinstalled gdb and pointed eclipse/Cubeide at it and still get launching failed.

The .gdbinit file does not seem to exist either.

Really buggy, before you even get any of your own bugs.

Please help.

BRose.2
Visitor II
February 21, 2020

I also ran into this issue after a couple days of everything working. This worked for me:

Select Project/Properties and select Run/Debug Settings. Delete all of the Launch configurations listed. Click Apply and Close.

The next time you try and debug, the Debug As dialog will pop up, select the STM32 Cortex-M C/C++ Application. That should fix it.

Until the next time it happens and you need to do all this again.