File tree Expand file tree Collapse file tree 4 files changed +13
-7
lines changed Expand file tree Collapse file tree 4 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 128
128
"fatal-error-auto-reboot-enabled" : {
129
129
"help" : " Setting this to true enables auto-reboot on a fatal error." ,
130
130
"value" : false
131
+ },
132
+ "use-mpu" : {
133
+ "help" : " Use the MPU if available to fault execution from RAM and writes to ROM. Can be disabled to reduce image size." ,
134
+ "value" : true
131
135
}
132
136
},
133
137
"target_overrides" : {
Original file line number Diff line number Diff line change 16
16
17
17
#include "platform/mbed_mpu_mgmt.h"
18
18
#include "platform/mbed_critical.h"
19
- #include "platform/mbed_error.h"
20
19
#include "platform/mbed_assert.h"
21
20
#include "hal/mpu_api.h"
22
21
#include <limits.h>
23
22
24
- #if DEVICE_MPU
23
+ #if DEVICE_MPU && MBED_CONF_PLATFORM_USE_MPU
25
24
26
25
static uint16_t mem_xn_lock ;
27
26
static uint16_t mem_wn_lock ;
Original file line number Diff line number Diff line change 23
23
#ifndef MBED_MPU_MGMT_H
24
24
#define MBED_MPU_MGMT_H
25
25
26
- #include "hal/sleep_api.h"
27
26
#include "mbed_toolchain.h"
28
- #include "hal/ticker_api .h"
27
+ #include "hal/mpu_api .h"
29
28
#include <stdbool.h>
30
29
31
30
#ifdef __cplusplus
32
31
extern "C" {
33
32
#endif
34
33
35
- #if DEVICE_MPU
34
+ #if (DEVICE_MPU && MBED_CONF_PLATFORM_USE_MPU ) || defined(DOXYGEN_ONLY )
35
+
36
+ #define mbed_mpu_manager_init () mbed_mpu_init()
36
37
37
38
/** Lock ram execute never mode off
38
39
*
@@ -84,6 +85,8 @@ void mbed_mpu_manager_unlock_rom_write(void);
84
85
85
86
#else
86
87
88
+ #define mbed_mpu_manager_init () (void)0
89
+
87
90
#define mbed_mpu_manager_lock_ram_execution () (void)0
88
91
89
92
#define mbed_mpu_manager_unlock_ram_execution () (void)0
Original file line number Diff line number Diff line change 77
77
#include "mbed_toolchain.h"
78
78
#include "mbed_boot.h"
79
79
#include "mbed_error.h"
80
- #include "mpu_api .h"
80
+ #include "mbed_mpu_mgmt .h"
81
81
82
82
int main (void );
83
83
static void mbed_cpy_nvic (void );
@@ -88,7 +88,7 @@ uint32_t mbed_stack_isr_size = 0;
88
88
89
89
void mbed_init (void )
90
90
{
91
- mbed_mpu_init ();
91
+ mbed_mpu_manager_init ();
92
92
mbed_cpy_nvic ();
93
93
mbed_sdk_init ();
94
94
mbed_rtos_init ();
You can’t perform that action at this time.
0 commit comments