threadxstm32h7azure-rtosarm-mpu

MPU subregions security for STM32H7


I am trying to understand the STM32H7 MPU example, In this example, only one region has been created for all the memory address space 4GB.
The subregion option is activated which means, it will be divided into 8 subregions starting from 0x0.
And SRD is set to 0x87 which means the MPU will be enabled only on: On-chip peripheral address space, external RAM, Shared device space.
This seems strange to me because we kept the most important address space unprotected for Flash, SRAM, System, and Non-shareable devices.
Any explanation of the reason the subregions were configured that way?


Solution

  • When a ThreadX Module thread is scheduled, the MPU is reconfigured such that the module can only access its code and data memory.