Skip to main content
Associate II
Oct 29, 2026 12:25 PM UTC
Solved

CubeMX 6.18.1 doesn't generate the MPU attribute config on STM32U3 (HAL_MPU_ConfigMemoryAttributes missing)

On the STM32U385 the generated MPU_Config() never configures any MPU attributes. Region settings are generated fine, but the attribute call is missing, so MPU_MAIR0 stays at its UNKNOWN reset value.

Setup

  • STM32CubeMX 6.18.1
  • STM32U385CGTx (eg. using the Nucleo-U385RG-Q), TrustZone disabled (CORTEX_M33_NS)

Steps

  1. System Core → CORTEX_M33 → MPU Control Mode: "Background Region Privileged accesses only + MPU Disabled during hard fault, NMI and FAULTMASK handlers"
  2. Region 0: enabled, base 0x08080000, limit 0x080FFFFF, Attributes Number = ATTRIBUTE 0
  3. Attributes Settings tab: Attributes 0 enabled, memory type "Normal non-cacheable"
  4. Generate code

Expected: MPU_Config() contains a HAL_MPU_ConfigMemoryAttributes() call for attribute 0.

Actual: only HAL_MPU_ConfigRegion() and HAL_MPU_Enable() are generated. I tried every memory type (Device, Normal non-cacheable, Normal cacheable) and none of them generates anything.

The .ioc does contain CORTEX_M33_NS.Attributes0-Cortex_Memory_Protection_Unit_Attributes0_Settings=MPU_ATTRIBUTES_NUMBER0. db/mcu/config/CORTEX_M33_NS-STM32U3xx_Configs.xml has a MPU_ConfigMemoryAttributes0 entry with HAL_MPU_ConfigMemoryAttributes, under the condition M33_MPU_ATTRIBUTES_ENABLED0_NS. As far as I can tell that condition is met, so I'd expect the call to be generated.
Workaround: set the attribute by hand in USER CODE BEGIN 1, before MPU_Config() is called:

MPU_Attributes_InitTypeDef mpu_attributes = {

    .Number     = MPU_ATTRIBUTES_NUMBER0,

    .Attributes = INNER_OUTER(MPU_NOT_CACHEABLE),

};

HAL_MPU_ConfigMemoryAttributes(&mpu_attributes);


Attached is a minimal .ioc file to reproduce it. 

 
Souhaib MAZHOUDBest answer
ST Technical Moderator
Oct 29, 2026 12:42 PM UTC

Hello ​@CecilW 

Thank you for your valuable contribution, 
This issue has been already raised to the dedicated team ( (Internal Ticket Numbers: CDM0066521) as discussed in this post, and it will be fixed in the upcoming releases 

BR, Souhaib

To give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.

1 reply

Souhaib MAZHOUDBest answer
ST Technical Moderator
Oct 29, 2026 12:42 PM UTC

Hello ​@CecilW 

Thank you for your valuable contribution, 
This issue has been already raised to the dedicated team ( (Internal Ticket Numbers: CDM0066521) as discussed in this post, and it will be fixed in the upcoming releases 

BR, Souhaib

To give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question.