cancel
Showing results for 
Search instead for 
Did you mean: 

Why the program go to Hard fault without any one instruct of main() run?

RZHU.1
Associate III

I am using the STM32H745 dual core MCU, and the CM7 can be run correctly, but the CM4 go to the Hard fault immediately, I set a breakpoint at the start of main() but can't capture it. Then I set a breakpoint at Reset_Handler in the startup file (startup_stm32h745iitx.s), it can't be captured either.

Why it could hanppened and what should I do to fix it?

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

Examine the SCB registers to determine the source of the hard fault and go from there.

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

View solution in original post

4 REPLIES 4
TDK
Guru

Examine the SCB registers to determine the source of the hard fault and go from there.

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

Many Eclipse-based IDEs have a "Run To Main" debug option, that is by default enabled. At least disable that.

Most toolchains/debugger support a breakpoint direct at the reset vector.

If that does not work, there is probably something wrong with your project. Perhaps a wrong startup code version (for another MCU variant).

Like, if the initial stackpointer points to an invalid address.

RZHU.1
Associate III

Thanks so much, that is a good way!

Thanks, I found some wrong in my project and I am still think that some BUGs are in STM32CubeIDE.