Global

group Global_CILmemoryProtection

CILmemoryProtection globals.

lorem

Macros

group Macros_CILmemoryProtection_h

Variables

group Variables_CILmemoryProtection_h

API’s

group Apis_CILmemoryProtection_h

Getters

group Getters_CILmemoryProtection_h

Setters

group Setters_CILmemoryProtection_h

Functions

void CILmemoryProtection_init(AddressType codeMemoryHighAddress, AddressType codeMemoryLowAddress, AddressType stackMemoryHighAddress, AddressType stackMemoryLowAddress, AddressType unprotectedMemoryLowAddress, AddressType unprotectedMemoryHighAddress)

Memory protection initialization. DEMO.

The implementation contains configuration of the all run-time static memory protected regions such as code memory, stack background memory, unprotected memory and OS configuration and variable partitions. In the beginning the memory protection is disabled by calling HAL_MPU_Disable function. Then the MPU for the code memory region is configured by setting MPU_InitStruct members and calling HAL_MPU_ConfigRegion function. Then the MPU for the stack background memory region is configured by setting MPU_InitStruct members and calling HAL_MPU_ConfigRegion function. Then the MPU for the OS configuration memory region is configured by setting MPU_InitStruct members and calling HAL_MPU_ConfigRegion function. Then the MPU for the OS variable memory region is configured by setting MPU_InitStruct members and calling HAL_MPU_ConfigRegion function. Then the MPU for the unprotected memory region is configured by setting MPU_InitStruct members and calling HAL_MPU_ConfigRegion function. The memory regions have a specific priority based on their number, this enables then insert another regions with higher priority during the run-time inside them to read/write from specific protected memory.

Parameters
  • codeMemoryHighAddress[in]

  • codeMemoryLowAddress[in]

  • stackMemoryHighAddress[in]

  • unprotectedMemoryLowAddress[in]

  • unprotectedMemoryHighAddress

Returns

none

void CILmemoryProtection_setStackOverflowProtection(AddressType stackLowAddress, AddressType stackHighAddress)

The implementation contains configuration of stack “window” type memory protected region which is placed inside the stack memory static region. In the beginning the memory protection is disabled by calling HAL_MPU_Disable function. The MPU for the stack window memory region is configured by setting MPU_InitStruct members and calling HAL_MPU_ConfigRegion function.

void CILmemoryProtection_setProgramMemoryProtection(AddressType lowAddress, AddressType highAddress)

Set program memory protection. This function cannot be called from the unprivileged context directly. DEMO.

The implementation contains configuration of program memory protected region which is placed inside the stack memory static region. In the beginning the memory protection is disabled by calling HAL_MPU_Disable function. The MPU for the stack window memory region is configured by setting MPU_InitStruct members and calling HAL_MPU_ConfigRegion function.

Parameters
  • lowAddress[in]

  • highAddress

Returns

none

void CILmemoryProtection_setSchedulablePeripheralProtection(AddressType lowAddress, AddressType highAddress)

Set schedulable peripheral protection. This function cannot be called from the unprivileged context directly. DEMO.

The implementation contains configuration of schedulable specific peripheral memory protected region which is placed inside the stack memory static region. In the beginning the memory protection is disabled by calling HAL_MPU_Disable function. The MPU for the stack window memory region is configured by setting MPU_InitStruct members and calling HAL_MPU_ConfigRegion function.

Parameters
  • lowAddress[in]

  • highAddress

Returns

none

General

group General_CILmemoryProtection_h