cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB55 Nucleo Hard Faults In SystemInit()

NZinn
Associate II

First time using a nucleo board and I am getting started with the stm32cubeide. I have selected the stm32wb55 nucleo board during project creation and used all the defaults for the cubemx autogeneration code which initializes the buttons and leds.

I am able to build the project, but when I run the code the mcu enters the hard fault handler after entering the SystemInit function called in the startup assembly code. The below picture shows the disassembly of the SystemInit function. While stepping through the disassembly, I found that I enter the hard fault handler immediately after executing the "add r7, sp, #0" instruction. 0690X000009819BQAQ.png

I've looked at other posts and some of the recommendations were to make sure that you compile with -mthumb option and indeed I am as this is one of the compile options specified for the elf file in the makefile. I'm not sure what could be wrong especially since this is all auto-generated and I have not edited a single line of code. All suggestions are appreciated, thanks.

1 ACCEPTED SOLUTION
2 REPLIES 2

#MadeForSTM32 but not tested

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