Skip to main content
CEkho.1
Associate II
June 5, 2021
Solved

How to configure external eclipse stm32 project so that it can be debugged as cube cortex application

  • June 5, 2021
  • 5 replies
  • 8768 views

Our project firmware is build using cmake. Cmake is used to create Eclipse project like this

cmake ..\Firmware -G"Eclipse CDT4 - Ninja" -DCMAKE_ECLIPSE_VERSION=4.16

I can import project to CubeIde without proplems and buid it there. Proplem is that CubeIde debugger configuration does seems to accept project as valid project for debuged in stm32.

I have also created bootloader using CubeIde and that I can use for debugging and I have attached Firmware elf to be loaded when BL is debugged. This is workaround to make possible to use CubeIde debugging our firmware.

I attach photo Eclipse error message when configuring debugger

0693W00000BaAcuQAF.jpgHow I should modify our Firmware project so that CubeIde can use it directly to debugging?

This topic has been closed for replies.
Best answer by Cartu38 OpenDev

As far as I'm aware no STM32CubeIDE is not open source.

Myself I would submit "So my improvement idea would be that CubeIde debugger configuration could have own settings for MCU. Then it could be used to debug what ever project." to Idea Zone (st.com) who knows you may win a new feature in coming releases

5 replies

TDK
June 5, 2021

What does the Debugger and Startup tabs look like?

"If you feel a post has answered your question, please click ""Accept as Solution""."
Cartu38 OpenDev
Graduate II
June 5, 2021

At that time STM32CubeIDE only support STM32Cube debug facilities if you're relying on STM32 toolchain.

Maybe you can mix following setup to your cmake project .... all such is just about project .metadata (i.e. .cproject file content).

0693W00000BaAjvQAF.jpg0693W00000BaAk0QAF.jpg0693W00000BaAk5QAF.jpgHere you're: you have a STM32 target device defined and so full access to STM32Cube debug facilities.

Nobody is forcing you to use CDT managed build setup ... just rely on cmake to build but debug is available to you once your binary file is availabe thru cmake

CEkho.1
CEkho.1Author
Associate II
June 5, 2021

Thank you both. Thank for tip about .cproject. I try to look what my bootloader .cproject contains and maybe I extend cmake system so that it will modificate firmware.cproject so that it will fill MCU information to there. Maybe that will help debugger to use project.

Cartu38 OpenDev
Graduate II
June 5, 2021

Let us know if working fiinally.

Small extra note ... myself I would be worried a bit by the fact your project name is including some special char like '@' ... may work but always some software failure risk related to such practice

CEkho.1
CEkho.1Author
Associate II
June 6, 2021

@ is generated by Cmake. At least building is working fine.

I tuned some time project files manually and I got strong feeling that debugger configuration is depending on build configuration and that's why I cannot make externally build elf file to be debugged.

My target would be that cmake can generate that kind project files what can be easily build and debug in some Ide.

When big teams work with same project then Eclipse project files are not optimal maintain because those will create bad conflicts in merge. Cmake project files are much easier to handle when multiple people develop.

CEkho.1
CEkho.1Author
Associate II
June 5, 2021

And after playing some time with project files I realised that debugger configuration has dependency that system is built in CubeIde. I think that using my CubeIde bootloader project as engine to debug Firmware is now cleanest solution for using CubeIde to debug Firmware. Only problem is that it may feel little bit weird at first. And it requires some amount configuration time to new team member to get working workspace for debugging.

So my improvement idea would be that CubeIde debugger configuration could have own settings for MCU. Then it could be used to debug what ever project.

CEkho.1
CEkho.1Author
Associate II
June 6, 2021

Is CubeIde debugger system open source? One option could be that I modify programmer so that it can use external configuration file to read debugging settings.

Cartu38 OpenDev
Cartu38 OpenDevBest answer
Graduate II
June 6, 2021

As far as I'm aware no STM32CubeIDE is not open source.

Myself I would submit "So my improvement idea would be that CubeIde debugger configuration could have own settings for MCU. Then it could be used to debug what ever project." to Idea Zone (st.com) who knows you may win a new feature in coming releases