Use MPU platform deinit rather than hal free

Use the MPU through the platform layer rather than through the HAL.
pull/9208/head
Russ Butler 2018-12-11 08:42:12 -06:00 committed by Cruz Monrreal II
parent 6f6cdc948b
commit bfc3d853e4
2 changed files with 6 additions and 2 deletions

View File

@ -19,7 +19,7 @@
#include <stdarg.h>
#include "device.h"
#include "platform/mbed_application.h"
#include "hal/mpu_api.h"
#include "platform/mbed_mpu_mgmt.h"
#if MBED_APPLICATION_SUPPORT
@ -69,7 +69,7 @@ void mbed_start_application(uintptr_t address)
SysTick->CTRL = 0x00000000;
powerdown_nvic();
powerdown_scb(address);
mbed_mpu_free();
mbed_mpu_manager_deinit();
#ifdef MBED_DEBUG
// Configs to make debugging easier

View File

@ -35,6 +35,8 @@ extern "C" {
#define mbed_mpu_manager_init() mbed_mpu_init()
#define mbed_mpu_manager_deinit() mbed_mpu_free()
/** Lock ram execute never mode off
*
* This disables the MPU's execute never ram protection and allows
@ -87,6 +89,8 @@ void mbed_mpu_manager_unlock_rom_write(void);
#define mbed_mpu_manager_init() (void)0
#define mbed_mpu_manager_deinit() (void)0
#define mbed_mpu_manager_lock_ram_execution() (void)0
#define mbed_mpu_manager_unlock_ram_execution() (void)0