mirror of https://github.com/ARMmbed/mbed-os.git
Add a platform config to disable the MPU
Add the platform config DISABLE_MPU to allow the MPU to be disabled from an application.pull/9040/head
parent
c1806765dd
commit
2af6642f68
|
@ -20,7 +20,7 @@
|
|||
|
||||
#if ((__ARM_ARCH_7M__ == 1U) || (__ARM_ARCH_7EM__ == 1U) || (__ARM_ARCH_6M__ == 1U)) && \
|
||||
defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) && \
|
||||
!defined(MBED_MPU_CUSTOM)
|
||||
!defined(MBED_MPU_CUSTOM) && !MBED_CONF_PLATFORM_DISABLE_MPU
|
||||
|
||||
#if !DEVICE_MPU
|
||||
#error "Device has v7m MPU but it is not enabled. Add 'MPU' to device_has in targets.json"
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#if ((__ARM_ARCH_8M_BASE__ == 1U) || (__ARM_ARCH_8M_MAIN__ == 1U)) && \
|
||||
defined (__MPU_PRESENT) && (__MPU_PRESENT == 1U) && \
|
||||
!defined(MBED_MPU_CUSTOM)
|
||||
!defined(MBED_MPU_CUSTOM) && !MBED_CONF_PLATFORM_DISABLE_MPU
|
||||
|
||||
#if !DEVICE_MPU
|
||||
#error "Device has v8m MPU but it is not enabled. Add 'MPU' to device_has in targets.json"
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if DEVICE_MPU
|
||||
#if DEVICE_MPU && !MBED_CONF_PLATFORM_DISABLE_MPU
|
||||
|
||||
/**
|
||||
* \defgroup hal_mpu MPU hal
|
||||
|
|
|
@ -128,6 +128,10 @@
|
|||
"fatal-error-auto-reboot-enabled": {
|
||||
"help": "Setting this to true enables auto-reboot on a fatal error.",
|
||||
"value": false
|
||||
},
|
||||
"disable-mpu": {
|
||||
"help": "Disable the MPU to save rom.",
|
||||
"value": false
|
||||
}
|
||||
},
|
||||
"target_overrides": {
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
#include "hal/mpu_api.h"
|
||||
#include <limits.h>
|
||||
|
||||
#if DEVICE_MPU
|
||||
#if DEVICE_MPU && !MBED_CONF_PLATFORM_DISABLE_MPU
|
||||
|
||||
static uint16_t mem_xn_lock;
|
||||
static uint16_t mem_wn_lock;
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if DEVICE_MPU
|
||||
#if DEVICE_MPU && !MBED_CONF_PLATFORM_DISABLE_MPU
|
||||
|
||||
/** Lock ram execute never mode off
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue