From 557d1a33313e0c31f56555f263d8a14cfb796f05 Mon Sep 17 00:00:00 2001 From: Thomas Decker Date: Thu, 20 Nov 2025 13:51:32 +0100 Subject: [PATCH] soc: st: stm32: h7rsxx: Fix MPU region for read-only id flash region Set correct MPU memory type and size for the uniqe device id, package code and ADC VREF/TS calibration read-only flash region. REGION_IO_ATTR configures the MPU region to device-memory with RW access, which is also used for the PERIPH region. To avoid complicating things unnecessarily, we use this type instead of defining a new device-RO. The size is reduced to 512 bytes, because RM0477 table 28 and chapter 5.3.12 state that this read-only flash area has a size of 512 bytes. Signed-off-by: Thomas Decker --- soc/st/stm32/stm32h7rsx/mpu_regions.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/soc/st/stm32/stm32h7rsx/mpu_regions.c b/soc/st/stm32/stm32h7rsx/mpu_regions.c index 35dfce848cded..02bb198cb744f 100644 --- a/soc/st/stm32/stm32h7rsx/mpu_regions.c +++ b/soc/st/stm32/stm32h7rsx/mpu_regions.c @@ -27,8 +27,8 @@ static const struct arm_mpu_region mpu_regions[] = { /* Region 3 */ MPU_REGION_ENTRY("SRAM_0", CONFIG_SRAM_BASE_ADDRESS, REGION_RAM_ATTR(REGION_SRAM_SIZE)), - /* Region 4 - Ready only flash with unique device id */ - MPU_REGION_ENTRY("ID", 0x08FFF800, REGION_FLASH_ATTR(REGION_2K)), + /* Region 4 - Ready only flash with unique device id, package code and VREF/TS calib*/ + MPU_REGION_ENTRY("ID", 0x08FFF800, REGION_IO_ATTR(REGION_512B)), #if DT_NODE_HAS_STATUS_OKAY(DT_NODELABEL(mac)) #define sram_eth_node DT_NODELABEL(sram2)