2024-10-02 06:28 AM
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.
Please help me debug the code.
2024-10-02 06:48 AM
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,
2024-10-02 07:02 AM - edited 2024-10-02 07:04 AM
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
2024-10-04 02:47 AM
Hello @gkowshik ,
I have checked with the FSMC_SRAM_DataMemory example and can confirm that a hard fault occurs during the execution of the SystemInit function.
An internal ticket 192898 has been submitted for a detailed investigation. Please note that this tracking number is for internal use only and is not accessible to customers.
Thank you for bringing this to our attention.
With regards,
2024-10-04 02:53 AM
Hi @SHs
Thanks for confirming this. Will await for an expert to come back on this, can you add a higher priority on this bug as this stops us from reaching the main function and cannot proceed to develop our application code.
Thanks
2024-10-04 02:56 AM
@gkowshik wrote:I am porting nRF8001 BLE library,
Wow - there's a blast from the past!!
Anyhow, on debugging Hard Faults:
2024-10-04 03:03 AM
@Andrew Neil Oh thanks for this man, but sadly I have already gone through your article, tried it out, root caused the instruction but I don't know WHY that instruction is causing the fault and how to resolve it.
When I said "I did some digging into the hard fault", I did it by following your article itself hahaha. That was very nice and detailed but it didn't resolve my problem.
Thanks,
G Kowshik