threadxazure-rtosarm-mpu

TXM_MODULE_MANAGER_16_MPU for STMEZH7


According to the application note AN4838 page 12, STMEZH7 has only 8 regions. However, there is the following statement in the project description of STM32H747I:

The TXM_MODULE_MANAGER_16_MPU is a Preprocessor define that should be added in both C and Assembly preprocessor define list to allow the application on the stm32H7xx family to work properly.

I searched for the symbole to see if it really refers to the MPU configuration of 16 regions instead of 8, and I found the following in the tx_thread_schedule:

config_mpu:
    LDM     r0!,{r2-r9}                             // Load MPU regions 0-3
    STM     r1,{r2-r9}                              // Store MPU regions 0-3
    LDM     r0!,{r2-r9}                             // Load MPU regions 4-7
    STM     r1,{r2-r9}                              // Store MPU regions 4-7
#ifdef TXM_MODULE_MANAGER_16_MPU
    LDM     r0!,{r2-r9}                             // Load MPU regions 8-11
    STM     r1,{r2-r9}                              // Store MPU regions 8-11
    // Regions 12-15 are reserved for the user to define.
    LDM     r0,{r2-r9}                              // Load MPU regions 12-15
    STM     r1,{r2-r9}                              // Store MPU regions 12-15
#endif

I have tried to remove the symbol for a project with STM32H735, but it gives unexpected behaviour. Does this means the AN is wrong and we can configure 16 regions and which also means we can configure 128 (16*8) subregions ?

EDIT: after the response from the linked manual P254, Removing the TXM_MODULE_MANAGER_16_MPU to indicate it has 16 regions results in unexpected behavior, the MPU_TYPE.DREGION= 0x10 which also indicates 16 regions, enter image description here enter image description here


Solution

  • The app note is unclear screenshot of app note

    Edit: The STM32H7xx chips should all have 8 region MPUs according to the programming guide https://www.st.com/resource/en/programming_manual/pm0253-stm32f7-series-and-stm32h7-series-cortexm7-processor-programming-manual-stmicroelectronics.pdf