AnsweredAssumed Answered

MPU S32K144 can not change region descriptor (RGD)

Question asked by Kevin Lau on Aug 5, 2019
Latest reply on Aug 13, 2019 by Daniel Martynek

Hi Dear Reader(s),


I am trying to exercise the memory protection unit functions, but anything that I changed the descriptor would take the codes to HardFault_Handler().  See line 116 to line 122 in the main.c from the attached file. These lines are copied below.


// Descriptor 0
// MPU->RGD[0].WORD0 = 0x1FFF8000; // start address
// MPU->RGD[0].WORD1 = 0x20000000; // end address
// MPU->RGD[0].WORD2 = 0x61f7df; // access R/W for masters: M7 - M0
// // 0x7df;
// //0x61f7df reset value suggests there are M3 - M0 masters.
// MPU->RGD[0].WORD3 = 1; // optional PID, PIDMask, Valid


I have also tried to write back what were in these registers, the mcu would go to HardFault_Handler().


Is there anything I need to change to enable the write to region descriptors?






PS. attached zip file.