From 66caf5826578ad396503cbf0bc3925b189b19d37 Mon Sep 17 00:00:00 2001 From: Francois Ramu Date: Tue, 25 Jul 2023 10:23:03 +0200 Subject: [PATCH] soc: arm: stm32h7x mapping system memory region System memory declared by the MPU as 'Strongly Ordered' with region attributes which will inhibit the speculative fetch, preventing the Flash RDSERR. Signed-off-by: Francois Ramu --- soc/arm/st_stm32/stm32h7/mpu_regions.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/soc/arm/st_stm32/stm32h7/mpu_regions.c b/soc/arm/st_stm32/stm32h7/mpu_regions.c index 16706e325eb..f2ba721d2df 100644 --- a/soc/arm/st_stm32/stm32h7/mpu_regions.c +++ b/soc/arm/st_stm32/stm32h7/mpu_regions.c @@ -12,6 +12,15 @@ static const struct arm_mpu_region mpu_regions[] = { REGION_FLASH_ATTR(REGION_FLASH_SIZE)), MPU_REGION_ENTRY("SRAM", CONFIG_SRAM_BASE_ADDRESS, REGION_RAM_ATTR(REGION_SRAM_SIZE)), + /* + * System memory attributes inhibit the speculative fetch, + * preventing the RDSERR Flash error + */ + MPU_REGION_ENTRY("SYSTEM", 0x1FF00000, + { (STRONGLY_ORDERED_SHAREABLE | + REGION_512K | + MPU_RASR_XN_Msk | P_RW_U_NA_Msk) }), + #if DT_NODE_HAS_STATUS(DT_NODELABEL(mac), okay) #if DT_NODE_HAS_STATUS(DT_NODELABEL(sram3), okay) MPU_REGION_ENTRY("SRAM3_ETH_BUF",