cancel
Showing results for 
Search instead for 
Did you mean: 

Debug works, run causes Hardfault

user 143
Associate III

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?

1 ACCEPTED SOLUTION

Accepted Solutions
user 143
Associate III

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

View solution in original post

1 REPLY 1
user 143
Associate III

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