Merge pull request #14821 from bergzand/pr/cortexm_common/enable_mpu_after_config

cortexm_common: Enable MPU after configuring regions
This commit is contained in:
Koen Zandberg 2020-08-23 18:02:40 +02:00 committed by GitHub
commit 659c351c02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -140,10 +140,6 @@ void reset_handler_default(void)
}
#endif /* CPU_HAS_BACKUP_RAM */
#if defined(MODULE_MPU_STACK_GUARD) || defined(MODULE_MPU_NOEXEC_RAM)
mpu_enable();
#endif
#ifdef MODULE_MPU_NOEXEC_RAM
/* Mark the RAM non executable. This is a protection mechanism which
* makes exploitation of buffer overflows significantly harder.
@ -169,6 +165,10 @@ void reset_handler_default(void)
}
#endif
#if defined(MODULE_MPU_STACK_GUARD) || defined(MODULE_MPU_NOEXEC_RAM)
mpu_enable();
#endif
post_startup();
/* initialize the board (which also initiates CPU initialization) */