[PATCH 3/7] bsps/stm32h7: enable cache and MPU only on Cortex-M7

Karel Gardas karel at functional.vision
Mon May 16 14:02:15 UTC 2022


Sponsored-By:	Precidata
---
 bsps/arm/stm32h7/start/bspstarthooks.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/bsps/arm/stm32h7/start/bspstarthooks.c b/bsps/arm/stm32h7/start/bspstarthooks.c
index ef26af5eba..10ae2bf0d3 100644
--- a/bsps/arm/stm32h7/start/bspstarthooks.c
+++ b/bsps/arm/stm32h7/start/bspstarthooks.c
@@ -101,7 +101,7 @@ void bsp_start_hook_0(void)
     HAL_Init();
     SystemInit_ExtMemCtl();
   }
-
+#if defined(CORE_CM7)
   if ((SCB->CCR & SCB_CCR_IC_Msk) == 0) {
     SCB_EnableICache();
   }
@@ -111,12 +111,15 @@ void bsp_start_hook_0(void)
   }
 
   _ARMV7M_MPU_Setup(stm32h7_config_mpu_region, stm32h7_config_mpu_region_count);
+#endif
 }
 
 void bsp_start_hook_1(void)
 {
   bsp_start_copy_sections_compact();
+#if defined(CORE_CM7)
   SCB_CleanDCache();
   SCB_InvalidateICache();
+#endif
   bsp_start_clear_bss();
 }
-- 
2.25.1



More information about the devel mailing list