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.WORD0 = 0x1FFF8000; // start address
// MPU->RGD.WORD1 = 0x20000000; // end address
// MPU->RGD.WORD2 = 0x61f7df; // access R/W for masters: M7 - M0
// // 0x7df;
// //0x61f7df reset value suggests there are M3 - M0 masters.
// MPU->RGD.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.