cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeIDE Cannot run program "gdb": Launching failed

MikeDB
Lead

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 ?

42 REPLIES 42
DEise
Associate II

I installed STM32CubeIDE and also get the

Error with command: gdb --version

Cannot run program "gdb": Launching failed 

message. Perhaps an explanation of how to install gdb and set up STM32CubeIDE to use it would be usefull. Documentation is usefull.

KnarfB
Principal III

UM2563 STM32CubeIDE installation guide ?

All external tools are installed during STM32CubeIde install in the plugins folder. On a recent Win10 install, compiler+debugger are in 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.

Avoid complications in the install path: no spaces, no long path, all ASCII.

DEise
Associate II

Hello - I was going to come back here and update. I went to Debug Configurations, and changes Debugger from gdb to arm-none-eabi-gdb, enabled Serial Wirer Viewer. That got me running. Just now commented out the " __HAL_AFIO_REMAP_SWJ_DISABLE()" call. I am running what I believe to be commonly known as the Blue Pill STM32F103C8 board. I am running my code now ..... thank you for making STM32CubeIDE available to hobbyists such as myself !

 I changed GDB debugger from gdb to arm-none-eabi-gdb, and enabled Serial Wirer Viewer. Thank you.

MFick.1
Associate II

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
Associate II

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
Associate II

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
Associate

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

KnarfB
Principal III

> 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.

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