MPU RAM execution disable utilities
Description
Simple utilities to disable execution on certain memory regions.
Simple utilities to disable execution from RAM and other selected memory regions. Useful to protect against code injection attacks.
Functions |
|
void | sl_mpu_disable_execute_from_ram (void) |
Configures internal SRAM as non-executable and enable MPU.
|
|
sl_status_t | sl_mpu_disable_execute (uint32_t address_begin, uint32_t address_end, uint32_t size) |
Configures an address range as non-executable and enable MPU.
|
|
Function Documentation
◆ sl_mpu_disable_execute_from_ram()
void sl_mpu_disable_execute_from_ram | ( | void |
|
) |
Configures internal SRAM as non-executable and enable MPU.
- Note
- This function configures the MPU in order to make the entire RAM as non-executable (with the exception of the functions marked as ramfunc).
◆ sl_mpu_disable_execute()
sl_status_t sl_mpu_disable_execute | ( | uint32_t |
address_begin,
|
uint32_t |
address_end,
|
||
uint32_t |
size
|
||
) |
Configures an address range as non-executable and enable MPU.
- Note
- Configures a MPU region in order to make an address range as non-executable. The memory region must have a size of at least 32 bytes.
- Parameters
-
address_begin
Beginning of memory segment. address_end
End of memory segment. size
Size of memory segment.
- Returns
- 0 if successful. Error code otherwise.