cancel
Showing results for 
Search instead for 
Did you mean: 

HardFault inside System Init - STM32L151CBUxA

gkowshik
Associate II

I am trying to run a code that's built using STM32L1x_Peripheral Libs for STM32L151CBUxA MCU.

As soon as I run the SystemInit function inside the ResetHandler I am hitting a Hardfault, so I investigated the SystemInit function.

Once the Vector Table relocation function is executed in it a HardFault is caused. I am unsure how to debug or resolve this.

gkowshik_0-1727875652572.png

Please help me debug the code.

2 REPLIES 2
SHs
ST Employee

Hello @gkowshik ,

Could you please provide your source code file or direct me to the example you are currently working on in order to investigate the issue on my side ?

 

With regards,

Please close this topic by clicking on “Accept as solution" button if it fully answered your question.

Hi @SHs ,

I am using a custom code, I am porting nRF8001 BLE library, I can attach the zip of my code here. I believe the hardfault is coming from the SystemInit function especially.

I did some digging into the hard fault and found the obvious instruction that's causing it i.e., the nop instruction right after the SystemInit function is executed (shown in the picture in previous reply). I need expert help to root cause it better.

Thanks