This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

MPU enabling triggers hard fault

Hi, I'm struggling with debugging a weird behaviour of my ARM-M3 board. I generated the following code with the ST IDE and what it does is configuring the MPU inside the SVC handler and then enabling it. However, as soon as the MPU is enabled (actually, as soon as the instruction "SCB->SHCSR |= SCB_SHCSR_MEMFAULTENA_Msk;" is executed) the MCU generates a hard fault.

I really don't know what to do about it and, since the code is pretty much it, I don't know how to get to the bottom of it. I would really appreciate any help. Thank you

0