# MPU fault: unprivileged access to privileged region at address 0x20001000

- **ID:** `embedded/arm-mpu-fault-unprivileged-access`
- **Domain:** embedded
- **Category:** system_error
- **Error Code:** `0x00000020`
- **Verification:** ai_generated
- **Fix Rate:** 88%

## Root Cause

MPU region configuration mismatch: code running in unprivileged mode attempted to read or write a memory region marked as privileged-only.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| ARM Cortex-M7 r1p0 | active | — | — |
| FreeRTOS 10.4.6 with MPU support | active | — | — |

## Workarounds

1. **Set MPU region attribute to 'privileged read-write, unprivileged execute never' for sensitive areas. Example: MPU->RBAR = (0x20001000 & MPU_RBAR_ADDR_Msk) | MPU_RBAR_VALID_Msk | (0 << MPU_RBAR_REGION_Pos); MPU->RASR = (0x3 << MPU_RASR_AP_Pos) | MPU_RASR_XN_Msk;** (90% success)
   ```
   Set MPU region attribute to 'privileged read-write, unprivileged execute never' for sensitive areas. Example: MPU->RBAR = (0x20001000 & MPU_RBAR_ADDR_Msk) | MPU_RBAR_VALID_Msk | (0 << MPU_RBAR_REGION_Pos); MPU->RASR = (0x3 << MPU_RASR_AP_Pos) | MPU_RASR_XN_Msk;
   ```
2. **Switch offending task to privileged mode by setting configUSE_TASK_FPU_SUPPORT to 1 and using vTaskPrioritySet to adjust.** (82% success)
   ```
   Switch offending task to privileged mode by setting configUSE_TASK_FPU_SUPPORT to 1 and using vTaskPrioritySet to adjust.
   ```

## Dead Ends

- **** — Disabling MPU entirely removes protection but does not fix root cause; security or safety requirements may be violated. (85% fail)
- **** — Increasing stack size does not resolve MPU access violations; fault is due to privilege level, not stack depth. (95% fail)
