cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging STM32H7 dual core

Curtis B.
Senior

Hello everybody,

I got myself the Nucleo H755 to try the STM32 dual core processeros. I set up a project with the cubeMX configurator in Cube IDE. I wrote a short "Hello Wolrd" application in which both cores are running and blinking some LEDs. The programm is working so far as intended when I flash both MCUs, both cores are running.

However, when I try to debug the project, only the M7 core is running, the M4 core is not running. I set up the debug configurations for the cores according to the application note AN5361 "Getting started with projects based on dual-core STM32H7 microcontrollers

in STM32CubeIDE"

I use STLINK GDB Sever for debugging. When I launch the M7 Debug configuration, the M7 core is running and the M4 core is not running. When I start the M4 debug configuration while the M7 configuration is running as stated on page 19 in the application note, the core is not in running mode, but in halt mode. If I press the play button, the debug session crashes.

Has anyone experience in debugging dual core projects? Am I missing something?

Best regards,

Daniel

5 REPLIES 5

I guess the real trick is not to need to single step your own code to know how it acts/behaves. Real time interaction and flow is much better seen with telemetry. Add instrumentation or side-channel displays as necessary.

With the professional tools (Keil, IAR) the approach is to have two instances running, one for each core with the source for each, and sharing the debug pod

https://www.st.com/resource/en/application_note/dm00597308-stm32h7x5x7-dualcore-microcontroller-debugging-stmicroelectronics.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

For starting out, is there a way to keep the M4 in reset, but still be able to use all the peripherals via the M7 alone? Or will some resources be unavailable?

We need the extended temperature range of the h745, but would prefer the simplicity of a single core like the h743!

TDK
Guru

There are debugger settings to halt the other cores while one is in debug. It's in the debug configuration. I know I had this working in STM32CubeIDE at one point.

Yes, you can use all peripherals with the M7 core.

You can keep the M4 core from booting by programming BOOT_CM4=0 in the option bytes. STM32CubeProgrammer can do this, among others.

If you feel a post has answered your question, please click "Accept as Solution".

Well, I made the experince that I need to dig very deep into the code with single step excecution to fix problems that I face during the development process. I do not want to miss this feature for the dual cores.

However I am not yet at the point to debug both core at once. I even didn't get to the point that both cores are running when the debugger is connected to the MCU.

When I exactly follow the instructions in the application note where it is stated:

"1. Launch the Cortex®-M7 configuration to download both the Cortex®-M4 and Cortex®-M7 images

2. Set the Cortex®-M7 core running so that the HSEM semaphore is released and Cortex®-M4 wakes up from

Stop mode

3. Launch the Cortex®-M4 configuration using the arrow next to the debug icon. It is in the running mode and

the user can halt it."

Somehow, step 2 does not work, otherwise the LED triggered by the CM4 should toggle. When I try step 3 I observe that the debugger states that the core is "paused" when I click the play button the debugging session crashes.

Curtis B.
Senior

I finally got it working. I don't know why it works this way but here's how I did it:

I selected connect under reset for the CM4, too. I first start the CM7 debugging session, second, I start the CM4 debugging session. In the CM7 session I press the Play-Button to set the M7 core running. In the CM4 session I need to single step through the code until I reach the main loop. Then, I can press the play button for the M4 core and both cores are running.