Presentation of the MPU feature. This example configures a memory area as privileged read-only, and attempts to perform read and write operations in different modes.
If the access is permitted LED4 is toggling. If the access is not permitted, a memory management fault is generated and LED4 is ON.
To generate an MPU memory fault exception due to an access right error, press user button.
Using STM32CubeIDE debugger, when hard fault is generated user shall press the debugger “Run” button to continue the execution
MPU, interrupt, MPU memory fault exception,
This example runs on STM32C031C6Tx devices.
This example has been tested with NUCLEO-C031C6 board and can be easily tailored to any other supported device and development board.
In order to make the program work, you must do the following :