title: TXM_MODULE_MANAGER_16_MPU for STMEZH7
body: <p>According to the application note <a href="https://www.st.com/resource/en/application_note/dm00272912-managing-memory-protection-unit-in-stm32-mcus-stmicroelectronics.pdf" rel="nofollow noreferrer">AN4838</a> page 12, STMEZH7 has only 8 regions.
  However, there is the following statement in the project <a href="https://github.com/STMicroelectronics/x-cube-azrtos-h7/blob/main/Projects/STM32H747I-DISCO/Applications/ThreadX/Tx_MPU/README.md" rel="nofollow noreferrer">description of STM32H747I</a>:</p>
  <blockquote>
  <p>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.</p>
  </blockquote>
  <p>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:</p>
  <pre><code>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
  </code></pre>
  <p>I have tried to remove the symbol for a project with STM32H735, but it gives unexpected behaviour. <strong>Does this means the AN is wrong and we can configure 16 regions and which also means we can configure 128 (16*8) subregions ?</strong></p>
  <p><strong>EDIT:</strong> 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,
  <a href="https://i.stack.imgur.com/544Nb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/544Nb.png" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/ThDWd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ThDWd.png" alt="enter image description here" /></a></p>