cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to debug a Makefile project into STM32CubeIDE

dgiovanelli
Associate III

Hello,

as the title suggests I would like to do step-by-step debugging on Makefile projects using STM32CubeIDE, however when I try to create the debug configuration it keeps showing an error message:

Not able to get mcu target

Reason:

Build configuration is not valide. Described mcu target is not supported

 

I'm on windows 10 and the target device is a nucleo L053R8. I created the Makefile project with CubeMX and imported with "Makefile project with existing code" into Eclipse.

Compilation works without problems but debugging blocks as described.

Then, is it possible to do debugging through ST-LINK in CubeIDE with Makefile projects?

Otherwise I could use plain Eclipse, but the only GDB server I found (github.com:texane/stlink.git) does not work on my computer/os/devkit combination. Is there any other solution?

Thank you,

Davide.

1 ACCEPTED SOLUTION

Accepted Solutions
mattias norlander
ST Employee

The way you did it is possible. But in CubeIDE 1.9.x and later you can use the

  1. File > New Makefile project with existing code
  2. Open the Build settings > MCU Settings and select which MCU the project/build configuration is targetting.

When this is done, the normal debugger solution the STM32 C/C++ Application debug type will work for you...

View solution in original post

6 REPLIES 6
dgiovanelli
Associate III

So, if I manually start the ST-Link server and I create a GDB Hardware Debugging configuration it works.

So now I just need a way to automatically start the ST-Link server when I launch that debug configuration. I'll report progresses here, but I'm still open to suggestions.

dgiovanelli
Associate III

Solved by using openOCD.

Just for completeness, I had to install openOCD first, then install the openOCD plugin for Eclipse (or for CubeIDE, it makes no difference). Then after playing a bit with the configuration (openocd command and options, .cfg file, etc) I managed to make it work both on Linux and also on Windows.

A long shot, as this is 2 years old - but are you still here, and do you still have details of those openOCD commands, options, or .cfg file, etc?

See: https://community.st.com/s/question/0D53W00000Y2lIsSAJ/cant-usecreate-debug-config-for-oss7-stack

See also: https://community.st.com/s/question/0D50X0000Avfxc1SQA/about-stm32cubeide-debug-open-ocd-and-stlink-gdb

embedded_guy
Associate

@Andrew Neil​ 

Hi Andrew, were you able to get this resolved?

I have a segger jlink and noticed that if I don't have the "Generate Makefiles automatically" in project Properties -> C/C++ Build settings, then I get an error that the mcu is not defined in the typical STM32 Cortex-M C/C++ Application debug configuration.

I have an older (more complex build procedure) project with its own makefile I'm using so trying to get that to build in cubeIDE AND debug...but not working out right.

Thanks.

Temporarily enabling 'Generate Makefiles automatically' seems to be the only option at the moment - with STM32 CubeIDE v1.6.0

See the post by @mattias norlander​ on March 4, 2021 at 3:30 PM in this thread:

https://community.st.com/s/question/0D53W00000aqNBiSAM/cubeide-imported-eclipse-c-project-incorrectly-defines-cplusplus

(stupid forum won't allow linking to a specific post in a thread).

mattias norlander
ST Employee

The way you did it is possible. But in CubeIDE 1.9.x and later you can use the

  1. File > New Makefile project with existing code
  2. Open the Build settings > MCU Settings and select which MCU the project/build configuration is targetting.

When this is done, the normal debugger solution the STM32 C/C++ Application debug type will work for you...