stm32h7:Support CONFIG_MPU_RESET and CONFIG_ARM_MPU_EARLY_RESET

This commit is contained in:
David Sidrane
2021-09-22 10:48:18 -07:00
committed by Xiang Xiao
parent e66423229a
commit e1a0a1188e
3 changed files with 11 additions and 2 deletions
+1 -1
View File
@@ -66,7 +66,7 @@ ifeq ($(CONFIG_STM32H7_PROGMEM),y)
CMN_CSRCS += stm32_flash.c CMN_CSRCS += stm32_flash.c
endif endif
ifeq ($(CONFIG_ARM_MPU),y) ifneq ($(filter y,$(CONFIG_ARM_MPU) $(CONFIG_ARM_MPU_EARLY_RESET)),)
CMN_CSRCS += arm_mpu.c CMN_CSRCS += arm_mpu.c
endif endif
+4
View File
@@ -70,6 +70,10 @@ void stm32_mpuinitialize(void)
mpu_showtype(); mpu_showtype();
/* Reset MPU if enabled */
mpu_reset();
/* Configure user flash and SRAM space */ /* Configure user flash and SRAM space */
mpu_user_flash(USERSPACE->us_textstart, mpu_user_flash(USERSPACE->us_textstart,
+6 -1
View File
@@ -36,6 +36,7 @@
#include "arm_internal.h" #include "arm_internal.h"
#include "barriers.h" #include "barriers.h"
#include "nvic.h" #include "nvic.h"
#include "mpu.h"
#include "stm32_rcc.h" #include "stm32_rcc.h"
#include "stm32_userspace.h" #include "stm32_userspace.h"
@@ -276,7 +277,11 @@ void __start(void)
"r"(CONFIG_IDLETHREAD_STACKSIZE - 64) :); "r"(CONFIG_IDLETHREAD_STACKSIZE - 64) :);
#endif #endif
/* Clear .bss. We'll do this inline (vs. calling memset) just to be /* If enabled reset the MPU */
mpu_early_reset();
/* Clear .bss. We'll do this inline (vs. calling memset) just to be
* certain that there are no issues with the state of global variables. * certain that there are no issues with the state of global variables.
*/ */