on 2026-02-05 4:36 AM
This article provides a step-by-step guide to learn how to run STM32H7 Dual-Core applications using STM32CubeIDE. It covers configuring the project, setting up both Cortex®-M7 and Cortex®-M4 cores.
This article provides a practical introduction to how to run projects based on STM32H7 dual-core microcontrollers using STM32CubeIDE. STM32H7 dual-core devices combine a high-performance Arm Cortex®-M7 core with a flexible Cortex®-M4 core, offering significant processing power and versatility for advanced embedded applications. The project structure for these devices is hierarchical, with separate subprojects and binaries for each core, allowing independent build and debug configurations for both the Cortex®-M7 and Cortex®-M4.
A critical aspect of dual-core development is understanding the boot and synchronization sequence. Typically, the Cortex®-M7 core is responsible for system initialization and resource setup, after which it releases the Cortex®-M4 core from reset or low-power mode. Respecting this sequence is essential to avoid synchronization issues and ensure correct system behavior.
By following these steps, you are able to develop, build, and debug robust applications for STM32H7 dual-core microcontrollers.
This article assumes that you have installed:
A dual core STM32H7 board for testing (in this article I use the NUCLEO-H755ZI-Q).
Open STM32CubeMX and click on [File] → [New project].
Click on "board selector" and select "NUCLEO-H755ZI-Q".
Once you have your ".ioc" file open, select "PF7" and "PF9" pins as "GPIO outputs".
In "GPIO menu", assign "PF9" pin to "Arm® Cortex® M4" and "PF7" Pin to "Arm® Cortex® M7".
In "project manager", select a name for your project then click [generate code].
Now, open "STM32CubeIDE" and open your generated project in it.
To visualize the results, we are going to add a pin toggle mechanism in cm7 and cm4 codes.
Under "CM7/Core/Src/main.c"
Add this code under "user code begin 3"
/* USER CODE BEGIN 3 */
HAL_GPIO_TogglePin(GPIOF, GPIO_PIN_7);
Under "CM4/Core/Src/main.c".
Add this code in "user begin code 3".
/* USER CODE BEGIN 3 */
HAL_GPIO_TogglePin(GPIOF, GPIO_PIN_9);
Now, right click in cm4 project "debug as/debug configuration"
Under "STM32 C/C++ application", select the "CM4" project, select "the startup" menu and select the existing file. Click on [edit], uncheck [Download], press ok and apply.
In the "debugger" menu, check [Allow other cores to halt this core] and [Signal halt events to other cores] in the "CTI" options and click [Apply].
Now, in the "CM7" project,
In the "Startup" menu, click add then add the CM4 project then click ok and apply.
In the "debugger" menu, ensure that there is a difference by at least 4 in GDB port numbers between CM7 and CM4
In my case, I have CM7 at port number 61234 and CM4 at port number 61238.
Check the "CTI" options.
Everything is set, click on CM7 project and run the project.
The compiler automatically flashes the CM7 project followed by the CM4 project.
To visualize results, we can use an oscilloscope or logic analyzer (in this case I use a logic analyzer)
Attach the PF7 pin and PF9 to the logic analyzer and start a record session
PF7 and PF9 are in PINS 28 and 26 of CN9.
The logic analyzer shows that there is only a 20 us delay between CM7 and CM4.
If you select to generate the project using LL instead of HAL:
And change the necessary toggling function to LL:
GPIOF->ODR ^= (GPIO_PIN_7); for cm7
GPIOF->ODR ^= (GPIO_PIN_9); for cm4
In LL you can expect a reduction in the delay to 12 us.
By following these steps, you can successfully run a project on the STM32H7 dual-core device using STM32CubeIDE and STM32CubeMX. This guide offers a practical approach. It covers environment setup, dual-core debugger configuration, and validation of the boot sequence to ensure a smooth and effective debugging experience for both the CM7 and CM4 cores.
Thanks for this comprehensive guide. It’s a great starting point for anyone working with STM32H7 dual-core MCUs.