ModusToolbox Safety Test Library
Loading...
Searching...
No Matches
MPU (ARM core MPU STL module)

General Description

Functional self-test for the ARM Cortex-M core MPU (CMSIS MPU->RBAR/RASR, ARM_MPU_*).

More Information

The self-test borrows one spare, currently-unused MPU region and temporarily marks it read-only over an application-provided 32-byte scratch block. It then attempts a privileged write to the first word of that block and verifies that:

  1. the CPU raises a MemManage fault with CFSR.DACCVIOL set and MMFAR equal to the scratch address, and
  2. the scratch word content is unchanged by the denied write.

The denied write is recovered in place: the application's MemManage exception handler forwards the fault to SelfTest_MPU_HandleMemManage, which rewrites the stacked return address so execution resumes immediately after the write, without resetting or halting the device.

Note
The application owns MemManage_Handler. This module does not install a strong MemManage_Handler and does not override the application's vector table. The application must provide a trampoline that forwards the exception stack frame to SelfTest_MPU_HandleMemManage. For the trampoline and dispatcher code and the link-time-optimization safeguards, see Memory and Storage Integrity Tests.

API Reference

 Macros
 
 Data Structures
 
 Functions