Hello,
I am working on S32K144 and I get a hard fault exception with the following data:
HFSR -> Forced = 1
SHCSR -> 0x00070000
CFSR -> all '0's
Can you please help out how to identify the reason behind that hard fault or which other registers that can be helpful?
Solved! Go to Solution.
Hi @ali_zein,
I'm able to reproduce this behavior by calling SVC instruction while the interrupts are blobaly masked (PRIMASK = 1).
Please make sure the interrupt are not masked.
Thank you,
BR, Daniel
Hello @chaitanya_kalyani
After some debugging It looks like the HardFault exception happens just on executing the following instruction "svc #1" during the OS start
Do you have any suggestion where I can look next?
Hi @ali_zein,
I'm able to reproduce this behavior by calling SVC instruction while the interrupts are blobaly masked (PRIMASK = 1).
Please make sure the interrupt are not masked.
Thank you,
BR, Daniel
Hello Daniel,
That's exactly was the problem, the interrupts where globally masked from the bootloader, and then the SVC exception was escalated to Hardfault.
Thanks a lot for your support (Y)
Hello @ali_zein ,
Once can you check MCU part number is same as you have configured.
Like if you configured program for S32K144 but if you are using S32K142 then also you can get hard fault error.
Hi @ali_zein,
You can use this example to find the instruction:
https://community.nxp.com/t5/S32K-Knowledge-Base/Fault-handling-on-S32K14x/ta-p/1114447
Regards,
Daniel
Thanks a lot Daniel,
I have checked that post previously, however I am not sure how to proceed as I find CFSR all 0s, so It's not really clear where to look..
Hello @ali_zein,
Can you please check it below points
1. Check control is comin to main or not. If control coming to main then check from where it is entering to hard fault from call stack (might be some wrong initialization)
2. If control is not coming to main then please check for MCU that you have selected is correct or not.
I hope this will help you to solve your problem.