Skip to content

Commit cdc61c5

Browse files
c1728p9kjbracey
authored andcommitted
Use MPU platform deinit rather than hal free
Use the MPU through the platform layer rather than through the HAL.
1 parent 7546186 commit cdc61c5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

platform/mbed_application.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#include <stdarg.h>
2020
#include "device.h"
2121
#include "platform/mbed_application.h"
22-
#include "hal/mpu_api.h"
22+
#include "platform/mbed_mpu_mgmt.h"
2323

2424
#if MBED_APPLICATION_SUPPORT
2525

@@ -69,7 +69,7 @@ void mbed_start_application(uintptr_t address)
6969
SysTick->CTRL = 0x00000000;
7070
powerdown_nvic();
7171
powerdown_scb(address);
72-
mbed_mpu_free();
72+
mbed_mpu_manager_deinit();
7373

7474
sp = *((void **)address + 0);
7575
pc = *((void **)address + 1);

platform/mbed_mpu_mgmt.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ extern "C" {
3535

3636
#define mbed_mpu_manager_init() mbed_mpu_init()
3737

38+
#define mbed_mpu_manager_deinit() mbed_mpu_free()
39+
3840
/** Lock ram execute never mode off
3941
*
4042
* This disables the MPU's execute never ram protection and allows
@@ -87,6 +89,8 @@ void mbed_mpu_manager_unlock_rom_write(void);
8789

8890
#define mbed_mpu_manager_init() (void)0
8991

92+
#define mbed_mpu_manager_deinit() (void)0
93+
9094
#define mbed_mpu_manager_lock_ram_execution() (void)0
9195

9296
#define mbed_mpu_manager_unlock_ram_execution() (void)0

0 commit comments

Comments
 (0)