cancel
Showing results for 
Search instead for 
Did you mean: 

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

CEkho.1
Associate II

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?

1 ACCEPTED SOLUTION

Accepted Solutions

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

View solution in original post

12 REPLIES 12
TDK
Guru

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

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

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.

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

Still extra tip if you have already a STM32CubeIDE boot loader project ... just rely on such to debug your cmake based binary ...

Based on bootloader project debug launch configuration you can add as many binaries as you want ...

See https://www.st.com/resource/en/user_manual/dm00629856-stm32cubeide-user-guide-stmicroelectronics.pdf page 113 load list is your best friend !

CEkho.1
Associate II

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.

Yes. This extra binary is exactly my system to use BL for debugging Firmware.

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

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.