Hard Fault exception with CFSR all '0's

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hard Fault exception with CFSR all '0's

Jump to solution
1,858 Views
ali_zein
Contributor I

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?

0 Kudos
Reply
1 Solution
1,781 Views
danielmartynek
NXP TechSupport
NXP TechSupport

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

 

View solution in original post

7 Replies
1,829 Views
ali_zein
Contributor I

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?

0 Kudos
Reply
1,782 Views
danielmartynek
NXP TechSupport
NXP TechSupport

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

 

1,741 Views
ali_zein
Contributor I

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)

0 Kudos
Reply
1,823 Views
chaitanya_kalyani
Contributor III

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.

 

0 Kudos
Reply
1,835 Views
danielmartynek
NXP TechSupport
NXP TechSupport

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

0 Kudos
Reply
1,829 Views
ali_zein
Contributor I

@danielmartynek 

 

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..

0 Kudos
Reply
1,846 Views
chaitanya_kalyani
Contributor III

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.

 

0 Kudos
Reply