48
CHAPTER 9
Memory Attributes
9.5 Memory Attributes
With
OS_MPU_AddRegion()
it is possible to set additional memory attributes for a specific
memory region. These memory attributes are core specific. For the actual meaning of the
Cortex-M memory attributes please have a look in the
ARM v7-M Architecture Reference
Manual
.
Prototype
void
OS_MPU_AddRegion(OS_TASK* pTask,
OS_U32 BaseAddr,
OS_U32 Size,
OS_U32 Permissions,
OS_U32 Attributes);
The following defines can be used with the
Attributes
parameter of
OS_MPU_AddRegion()
:
Define
Explanation
OS_ARM_CACHEMODE_STRONGLY_ORDERED
Strongly ordered
OS_ARM_CACHEMODE_SHAREABLE_DEVICE
Shareable Device
OS_ARM_CACHEMODE_WRITE_THROUGH
Outer and Inner Write-Through, no Write-
Allocate
OS_ARM_CACHEMODE_WRITE_BACK_NO_ALLOC
Outer and Inner Write-Back, no Write-Allo-
cate
OS_ARM_CACHEMODE_NON_CACHEABLE
Outer and Inner Non-cacheable
OS_ARM_CACHEMODE_WRITE_BACK_ALLOC
Outer and Inner Write-Back, Write and
Read-Allocate
Example:
void
HPTask(
void
) {
OS_MPU_AddRegion(&TCBHP, (OS_U32)MyQBuffer,
512
,
OS_MPU_READWRITE, OS_ARM_CACHEMODE_WRITE_BACK_ALLOC);
OS_MPU_SwitchToUnprivState();
while
(
1
) {
DoSomething()
OS_TASK_Delay(
10
),
}
}
embOS-MPU for Cortex-M and IAR
© 2010-2020 SEGGER Microcontroller GmbH