S32K146 debug mpu demo can't entry memmanage exceptions

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

S32K146 debug mpu demo can't entry memmanage exceptions

跳至解决方案
1,973 次查看
John_zhou2
Contributor I

Hi,

IDE: S32DS3.5
Board:S32k146-EVB
SDK:S32_SDK_S32K1xx_RTM_4.0.2

 

 


Demo:
S32_SDK_S32K1xx_RTM_4.0.2\examples\S32K146\driver_examples\system\mpu_memory_protection
S32_SDK_S32K1xx_RTM_4.0.2\examples\S32K146\driver_examples\system\mpu_pal_memory_protection

I used this demo to check MPU function, the demo can run success.
Then I want know if the MPU triger access denied, which exception that will be triger,
so I add this test code to demo,before call MPU_Init,this code add:

S32_SCB->SHCSR |= 0x70000; /* TODO Add enable all fault check */​


And I add some fault handler function:

 

void MemManage_Handler(void)
{
NOP();
}
void BusFault_Handler(void)
{
NOP();
}
void UsageFault_Handler(void)
{
NOP();
}

 

Add breakpoint to NOP(), when I run the test, it will be only enter BusFault_Handler.

 

Question 1:When triger MPU access denied, which execption it maybe enter.

Question 2:If it should enter MemManage_Handler, how to config the register.

Question 3:All kinds of MPU access denied, it enter same execption or not.

 

Thanks!

John.zhou

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

HI @John_zhou2,

This is because the ARM CM4 MPU that would detect a MemManage fault is not implemented on the S32K1xx series.

Instead, there is an NXP System MPU implemented at the crossbar switch, any denied access results in a Bus fault.

danielmartynek_0-1701424961597.png

danielmartynek_1-1701425014347.png

 

BR, Daniel

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,954 次查看
John_zhou2
Contributor I

Hi Daniel,

    This issue is solution.

    Thanks for your relpay!

BR, John

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

HI @John_zhou2,

This is because the ARM CM4 MPU that would detect a MemManage fault is not implemented on the S32K1xx series.

Instead, there is an NXP System MPU implemented at the crossbar switch, any denied access results in a Bus fault.

danielmartynek_0-1701424961597.png

danielmartynek_1-1701425014347.png

 

BR, Daniel

0 项奖励
回复