Skip to main content
RZHU.1
Associate III
November 5, 2020
Solved

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

  • November 5, 2020
  • 2 replies
  • 1273 views

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?

This topic has been closed for replies.
Best answer by TDK

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

2 replies

TDK
TDKBest answer
November 5, 2020

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""."
RZHU.1
RZHU.1Author
Associate III
November 9, 2020

Thanks so much, that is a good way!

Ozone
Principal
November 6, 2020

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
RZHU.1Author
Associate III
November 9, 2020

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