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

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

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

Jump to solution
1,272 Views
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 Kudos
Reply
1 Solution
1,231 Views
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

View solution in original post

0 Kudos
Reply
4 Replies
1,259 Views
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 Kudos
Reply
1,257 Views
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 Kudos
Reply
1,232 Views
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 Kudos
Reply
1,200 Views
bohee2
Contributor II

Thank you!
Thanks to you, I solved it

0 Kudos
Reply