Skip to main content
user 143
Associate III
November 25, 2019
Solved

Debug works, run causes Hardfault

  • November 25, 2019
  • 1 reply
  • 687 views

Hello,

I've got a realy strange issue. I'm using an STM32F107, with SW4STM32 and CubeMX. The controller is on a custom board.

When I click on "Run" in eclipse, the controller is not starting. It seemed, that he's going immediately in a HardFault. Even when I poweroff the powersupply and reconnect the controller, it's not starting.

When I run the debugger for the first time after a normal "Run" the controller jumps into Hardfault. But immediately. I've got a breakpoint at the beginning of the main(), but this point is never reached.

When I'm exiting the debugger and debug again, everything works fine. I can power on and off the controller as many times as I want, it still works fine.

In the HFSR the FORCED bit is set. In the BSFR the bits IMPRECISERR and STKERR are set.

In eclipse, both "Run" and "Debug" mode are using the same build configuration.

Does anyone have any further suggestions where I could look for the error reason?

This topic has been closed for replies.
Best answer by user 143

Found my error. I've got two projects, a bootloader and the main firmware. The main firmware was deleting the area of the bootloader.

https://www.openstm32.org/forumthread5007

1 reply

user 143
user 143AuthorBest answer
Associate III
November 25, 2019

Found my error. I've got two projects, a bootloader and the main firmware. The main firmware was deleting the area of the bootloader.

https://www.openstm32.org/forumthread5007