cancel
Showing results for 
Search instead for 
Did you mean: 

errors running CDT Builder

ljk
Visitor

Question 1: STM32CubeMX and STM32CubeIDE Integration Issue

When I create a project using STM32CubeMX (with .ioc file) and then open it in STM32CubeIDE, the IDE shows Import Successful. However, when I try to build the project in IDE, I get the following error:

Errors occurred during the build.
Errors running builder 'CDT Builder' on project 'M33LED_CM33'.
Cannot invoke "com.st.stm32cube.common.mx.registry.IIdeHelper.getRootProject(org.eclipse.core.resources.IProject)" because the return value of "com.st.stm32cube.common.mx.registry.MxRegistry.getIdeHelper()" is null

I have searched through many posts and forums regarding this issue, but there doesn't seem to be a definitive solution. Most users have either switched to CMake or abandoned the IDE for compilation entirely.

This error only issue while importing the mx project into IDE. As compare, while I creating some empty STM32 or CMAKE project in IDE and build them, all work well.

Question 2: CMake Project Generation

It appears that STM32CubeMX can only create STM32CubeIDE project files, and there is no option to generate CMake projects. Is this correct?

If so, what is the most convenient workflow for resource configuration and code generation for STM32MP2 M33 bare-metal development?

Specifically:

  • Should I use STM32CubeMX for pin/clock configuration and then manually create a CMake project?
  • Or is there a better recommended workflow for MP2 series development?

Additional Context:

  • Project Type: Cortex-M33 bare-metal (non-secure, TrustZone disabled)

Development Environment:

  • OS: Windows 11
  • STM32CubeIDE Version: 2.1.1
  • STM32CubeMX Version: 6.17 (Build 20250711659)
  • MPU Model: STM32MP257FAK

 

related issue:

https://community.st.com/t5/stm32cubeide-mcus/when-installing-using-different-toolchain-quot-error-running-cdt/m-p/757190#M33285

https://community.st.com/t5/stm32cubeide-mcus/quot-errors-running-builder-cdt-builder-quot-after-update-to/m-p/126416#M4654

https://community.st.com/t5/stm32cubeide-mcus/stm32cubeide-v1-9-0-throws-null-exception-when-building-project/m-p/132392

https://community.st.com/t5/stm32cubeide-mcus/errors-building-a-project/m-p/688419#M28261

 

3 REPLIES 3
AScha.3
Super User

Sidekick tells:

1. Creating a CMake Project with STM32CubeMX

To create a CMake project using STM32CubeMX, follow these steps:

  1. Open STM32CubeMX and select File > New Project to start a new project.
  2. Choose your target device (MCU/MPU or board) and click Start Project.
  3. In the Project Manager, enter a project name and select CMake as the toolchain/IDE.
  4. Configure the MCU: Set up pins, enable peripherals, and add required software components using the graphical interface.
  5. Click Generate code (or Generate IDE project in STM32CubeMX2). This creates a project directory with generated source code and CMake files.
  6. The generated project can be opened in Visual Studio Code or imported into STM32CubeIDE for further development. This ensures the project is ready for development with preconfigured peripherals, clock settings, and middleware.

2. Detailed Steps for CMake Project Generation

  • Project Structure: The generated project contains:
    • .ioc project file (user configuration)
    • Drivers and Middlewares folders (firmware package files)
    • Inc and Src folders (middleware, peripheral, and GPIO initialization code, including main.c)
    • User-dedicated code sections to preserve custom code during regeneration
  • IDE Integration:
    • Open the generated project in your preferred IDE (e.g., Visual Studio Code or STM32CubeIDE).
    • For Visual Studio Code, select a CMake preset (Debug or Release), then run the CMake configure step, which generates build files in a build/$CMakePresetName folder.
    • If needed, use the STM32CubeIDE for Visual Studio Code extension to discover and set up the STM32Cube project, select the board/device, toolchain, and project target, then save and close.
  • User Code Preservation: Only add user code within the dedicated user sections in generated files to ensure it is preserved during code regeneration.

3. Project Structure and IDE Integration

  • The STM32CubeMX-generated project structure is designed for seamless integration with IDEs:
    • For STM32MP13 Bare Metal projects: .settings, Application, Core, and Drivers folders.
    • For STM32MP15 projects: .settings, CA7, CM4, and shared folders for Common, Drivers, and Middlewares.
    • The .project file is used to import the project into STM32CubeIDE.
  • After generating code in STM32CubeMX, you can open or import the project directly in STM32CubeIDE, which recognizes the structure and manages the build and debug processes accordingly.

Summary

To create a CMake project with STM32CubeMX:

  • Start a new project, select your device, and choose CMake as the toolchain.
  • Configure your MCU and peripherals, then generate the code.
  • Open the generated project in your preferred IDE (STM32CubeIDE or Visual Studio Code).
  • The project structure and CMake integration are designed for easy development and debugging.
If you feel a post has answered your question, please click "Accept as Solution".
ljk
Visitor

while using mx generate a cmake code and import it in ide. I can only see some includes files. the src, common, drivers file eventually disappeared.

However, when I try to build the project in IDE, I get the following error:

When you generate a project with CubeMX, make sure to generate for CubeIDE. Older CubeMX versions by default generate for IAR.

After importing the project, do Refresh, then Properties -> C/C++ Build-> Settings; see if it looks good.

Avoid using unsupported exotic Linux versions; for best results use Windows (it just works).

>  It appears that STM32CubeMX can only create STM32CubeIDE project files, and there is no option to generate CMake projects. Is this correct?

No. You can select the project type, including CMake.