MemManage and HardFault come up when debugging, so it doesn't work

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

MemManage and HardFault come up when debugging, so it doesn't work

跳至解决方案
1,265 次查看
bohee2
Contributor II

Hello.

I'm currently using the s32k324 board.
I'm running a simple example code, but I get the following two errors while debugging


MemManage: The processor attempted an instruction fetch from a location that does not permit execution.
HardFault: A fault has been escalated to a hard fault.

Can you tell me the solution?

Thank you.

0 项奖励
回复
1 解答
1,224 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @bohee2,

In system.c of the RTD version, the MPU region 2 is not configured on S32K324.

danielmartynek_0-1739523808523.png

As you can see above, S32K324 macro is missing.

Solution is to add S32K324 there so that RASR[2] is configured 

rasr[2]=0x070B0027UL;

 

Regards,

Daniel

在原帖中查看解决方案

0 项奖励
回复
4 回复数
1,252 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @bohee2,

Which revision of the RTD do you use?

There have been some issues with the MPU configuration in system.c for some S32K3xx derivatives.

In general, MemManage faults are caused by MPU access violation.

You can disable the MPU in system.c

 

Regards,

Daniel

0 项奖励
回复
1,250 次查看
bohee2
Contributor II

Thank you for your answer.

RTD is using 3.0.0 version. I will attach the picture.

bohee2_0-1739444517454.png

 


Is this an error caused by the RTD version? I am asking because such an error does not occur when it is 5.0.0.

Thank you

0 项奖励
回复
1,225 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hi @bohee2,

In system.c of the RTD version, the MPU region 2 is not configured on S32K324.

danielmartynek_0-1739523808523.png

As you can see above, S32K324 macro is missing.

Solution is to add S32K324 there so that RASR[2] is configured 

rasr[2]=0x070B0027UL;

 

Regards,

Daniel

0 项奖励
回复
1,193 次查看
bohee2
Contributor II

Thank you!
Thanks to you, I solved it

0 项奖励
回复