Mbed OS Reference
Loading...
Searching...
No Matches
MPU hal

The MPU hal provides a simple MPU API to enhance device security by preventing execution from ram. More...

Modules

 MPU hal tests
 The MPU test validates proper implementation of the MPU hal.
 

Functions

void mbed_mpu_init (void)
 Initialize the MPU. More...
 
void mbed_mpu_enable_rom_wn (bool enable)
 Enable or disable ROM MPU protection. More...
 
void mbed_mpu_enable_ram_xn (bool enable)
 Enable or disable ram MPU protection. More...
 
void mbed_mpu_free (void)
 Deinitialize the MPU. More...
 

Detailed Description

The MPU hal provides a simple MPU API to enhance device security by preventing execution from ram.

Defined behavior

Undefined behavior

See also
MPU hal tests

Function Documentation

◆ mbed_mpu_init()

void mbed_mpu_init ( void  )

Initialize the MPU.

Initialize or re-initialize the memory protection unit. After initialization or re-initialization, ROM and RAM protection are both enabled.

◆ mbed_mpu_enable_rom_wn()

void mbed_mpu_enable_rom_wn ( bool  enable)

Enable or disable ROM MPU protection.

This function is used to mark all of ROM as read and execute only. When enabled writes to ROM cause a fault.

By default writes to ROM are disabled.

Parameters
enabletrue to disable writes to ROM, false otherwise

◆ mbed_mpu_enable_ram_xn()

void mbed_mpu_enable_ram_xn ( bool  enable)

Enable or disable ram MPU protection.

This function is used to mark all of RAM as execute never. When enabled code is only allowed to execute from flash.

By default execution from RAM is disabled.

Parameters
enabletrue to disable execution from RAM, false otherwise

◆ mbed_mpu_free()

void mbed_mpu_free ( void  )

Deinitialize the MPU.

Powerdown the MPU in preparation for powerdown, reset or jumping to another application.