Now,I want to set the address(0~0x77fff) unreadable.
pangyun_0-1750754639157.png
pangyun_1-1750754666963.png
pangyun_2-1750754682557.png
pangyun_3-1750754698829.png
pangyun_4-1750754715209.png
s32k144 debug flash
code 1:
#define ADDRESS_PROTECT 0x0000U
(void)MPU_EnableRegion(&mpu_pal_config_1_Instance, 2U, true);
test = *((uint32_t *)ADDRESS_PROTECT);
Like this, It can be OK.
code 2:
(void)MPU_EnableRegion(&mpu_pal_config_1_Instance, 2U, false);
//test = *((uint32_t *)ADDRESS_PROTECT);
it is always in "void HardFault_Handler(void)", I can't understand this, because I don't read any address,It should be normal,but it's not,why?