mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
stm32h7:Support CONFIG_MPU_RESET and CONFIG_ARM_MPU_EARLY_RESET
This commit is contained in:
committed by
Xiang Xiao
parent
e66423229a
commit
e1a0a1188e
@@ -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
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user