cancel
Showing results for 
Search instead for 
Did you mean: 

Debug CMake project with STM32CubeIDE

JHeni.1
Associate II

0693W00000D08PGQAZ.pngHey, I'm using the latest Cube IDE and would like to Debug a Cmake Project.

I'm using an Stm32F429 Disc Board for testing purposes.

The Project Structure looks like this:

  • myProjectSourceCode
    • app (contains main() + ASM Startup Code + App Code)
    • modules
      • SomeModuleCode (this code is used in multple applications)
      • STM32GeneratedCode (this code was generated using Stm32Cube IDE. It contains the ioc file + all STM32 HAL drivers)
  • SomeExternalLibaries
  • build

Simple Debugging of the generated code works nicely =>so there is no hardware issue there

I imported the whole project structure as a "makefile project". By doing so I can actually build this cmake project within STM32CubeIDE.

Now the problems arise when I try to create a debug config.

STM32CubeIDE always tells the that no target device was found.

How can I tell the debugger that the target is an STM32F429?

Could you help me out here?

thx, greets Julian

1 ACCEPTED SOLUTION

Accepted Solutions

The new "project-less" debugging in v 1.7.0 works as described in the fine manual.

Here are steps, to save you time:

1. Though an existing project is not needed, Eclipse always wants a workspace. Give it a workspace.

2. File... Import .... STM32 Cortex-M Executable

3. Browse or enter path of the .elf file and select the STM32 model.

4. Then it will open the usual debug config dialog, with the .elf file selected. 

Debug as usual.

This procedure actually will create a new empty STM32 makefile-based project.

You can tweak it later.

If there's a popup asking to update ST-LINK firmware and your firmware is new enough (works well with v 1.6.x) you probably can dismiss the popup.

Unfortunately, v 1.7.0 still does not enable easy debugging of makefile-type projects created by other Eclipes and imported into CubeIDE.

This would be very useful. ST, please do it soon.

-- pa

View solution in original post

6 REPLIES 6
Cartu38 OpenDev
Lead II

Just download or update to today 1.7.0 STM32CubeIDE release .... you should be able to.

2 ways depending of your settings:

+ Either from project properties > C / C++ build > Settings > Mcu ... just set select your target device

+ Or File > Import > C/C++ > STM32 CortexM executable

JHeni.1
Associate II

Hey I'm already running 1.7.0.

Is there any major change regarding my problem?0693W00000D08ULQAZ.png

Is 1.7.0 helpful to you ?

JHeni.1
Associate II

0693W00000D0EfLQAV.pngHey thx for your answers.

The tab "MCU" is not available from this CMake project (can i somehow enable it)

I'll try to test your second suggestion File > Import > C/C++ > STM32 CortexM executable and provide feedback. :)

The new "project-less" debugging in v 1.7.0 works as described in the fine manual.

Here are steps, to save you time:

1. Though an existing project is not needed, Eclipse always wants a workspace. Give it a workspace.

2. File... Import .... STM32 Cortex-M Executable

3. Browse or enter path of the .elf file and select the STM32 model.

4. Then it will open the usual debug config dialog, with the .elf file selected. 

Debug as usual.

This procedure actually will create a new empty STM32 makefile-based project.

You can tweak it later.

If there's a popup asking to update ST-LINK firmware and your firmware is new enough (works well with v 1.6.x) you probably can dismiss the popup.

Unfortunately, v 1.7.0 still does not enable easy debugging of makefile-type projects created by other Eclipes and imported into CubeIDE.

This would be very useful. ST, please do it soon.

-- pa

JHeni.1
Associate II

thx Pavel, That worked really well!