cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 Dual Core Project in CLion with Platformio and CubeMX

eon
Associate

 

Hello everyone,

I am currently working on an STM32H745ZI-Q dual-core project and want to generate the code using CubeMX, compile and flash it with PlatformIO, and use CLion as my development environment.

My primary goal is to understand the best approach for setting up a dual-core project with these tools, particularly how boot configuration, toolchain selection, and PlatformIO integration should be handled. Below are my key questions and observations.


1. Best Approach for STM32H745 Dual-Core Setup in CLion & PlatformIO

I want to use CubeMX for code generation and then compile, flash, and debug using PlatformIO within CLion.

  • Is CubeMX + PlatformIO + CLion a viable workflow for dual-core projects?
  • Does PlatformIO properly support compiling, flashing, and debugging dual-core STM32 projects?
  • Are there any known limitations when handling two cores in PlatformIO?

2. Toolchain Selection in CubeMX for PlatformIO Compatibility

CubeMX requires selecting a Toolchain/IDE when generating code.

  • Right now, I have selected EWARM (IAR) because it seems to be ignored by PlatformIO and CLion, allowing me to use my custom setup.
  • Would it be better to select CMake instead?

3. Boot Configuration: Both Cores at Once vs. Sequential Boot (CM7 First, Then CM4)

Currently, CubeMX has the "Dual Core Boot Mode" field greyed out, and it is set to "Both CPUs booting at once". While this setup is fine for me, I want to understand whether it is possible to boot CM7 first and start CM4 later.


4. Handling Flashing and Debugging for Dual-Core in PlatformIO

Since I use PlatformIO, I need to ensure both cores are flashed and debugged correctly.

  • Should both cores be flashed at once, or separately?
  • How does debugging work in PlatformIO for dual-core projects?
  • Does PlatformIO support stepping through both CM7 and CM4, or are extra configurations needed?

5. PlatformIO Configuration – Is My Setup Correct?

I have structured my platformio.ini as follows, separating the M7 and M4 environments:

 

 
KopierenBearbeiten
[env:m7]
platform = ststm32
board = nucleo_h745zi_q
framework = stm32cube
build_flags = -DCORE_CM7
build_src_filter = +<CM7/Src/> +<Common/> +<Drivers/> -<CM4/> 
 
[env:m4]
platform = ststm32
board = nucleo_h745zi_q
framework = stm32cube
build_flags = -DCORE_CM4
build_src_filter = +<CM4/Src/> +<Common/> +<Drivers/> -<CM7/>

6. Missing Startup Files and Boot Code in CubeMX

When generating the project with CubeMX, I noticed that some expected startup files are missing, including:

  • startup_stm32h745xx_cm4.s (for CM4)
  • startup_stm32h745xx_cm7.s (for CM7)

However, I do see a file in the Common folder named:

  • system_stm32h7xx_dualcore_boot_cm4_cm7.c

  • Is this file meant to replace the missing startup files?


7. Summary of Open Questions

  1. Is CubeMX + PlatformIO + CLion a viable workflow for STM32H745 dual-core projects?
  2. Which toolchain should be selected in CubeMX for best compatibility with PlatformIO?
  3. How to configure CM7-first boot in CubeMX, or is this not officially supported?
  4. How should flashing and debugging be handled in a dual-core PlatformIO setup?
  5. Why are some CubeMX-generated startup files missing, and how should they be handled?
  6. Is my PlatformIO configuration correctly set up for dual-core development?

I appreciate any insights from those who have set up, compiled, flashed, and debugged an STM32H745 dual-core project using CubeMX and PlatformIO in CLion.

Thanks in advance!
Leon

1 REPLY 1
mƎALLEm
ST Employee

Hello @eon and welcome to the community,

For Platformio environement, better to ask them on their community on this link.

On this community, we can help on ST dev environment: STM32CubeMx/STM32CubeIDE/STM32CubeProgrammer etc ..

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.