Hard Fault exception with CFSR all '0's

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Hard Fault exception with CFSR all '0's

跳至解决方案
2,158 次查看
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 项奖励
回复
1 解答
2,081 次查看
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

 

在原帖中查看解决方案

7 回复数
2,129 次查看
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 项奖励
回复
2,082 次查看
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

 

2,041 次查看
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 项奖励
回复
2,123 次查看
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 项奖励
回复
2,135 次查看
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 项奖励
回复
2,129 次查看
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 项奖励
回复
2,146 次查看
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 项奖励
回复