Cortex-M4 Peripherals
ARM DUI 0553A
Copyright © 2010 ARM. All rights reserved.
4-37
ID121610
Non-Confidential
4.5
Optional Memory Protection Unit
This section describes the optional
Memory Protection Unit
(MPU).
The MPU divides the memory map into a number of regions, and defines the location, size,
access permissions, and memory attributes of each region. It supports:
•
independent attribute settings for each region
•
overlapping regions
•
export of memory attributes to the system.
The memory attributes affect the behavior of memory accesses to the region. The Cortex-M4
MPU defines:
•
eight separate memory regions, 0-7
•
a background region.
When memory regions overlap, a memory access is affected by the attributes of the region with
the highest number. For example, the attributes for region 7 take precedence over the attributes
of any region that overlaps region 7.
The background region has the same memory access attributes as the default memory map, but
is accessible from privileged software only.
The Cortex-M4 MPU memory map is unified. This means instruction accesses and data
accesses have same region settings.
If a program accesses a memory location that is prohibited by the MPU, the processor generates
a MemManage fault. This causes a fault exception, and might cause termination of the process
in an OS environment. In an OS environment, the kernel can update the MPU region setting
dynamically based on the process to be executed. Typically, an embedded OS uses the MPU for
memory protection.
Configuration of MPU regions is based on memory types, see
.
shows the possible MPU region attributes. These include Shareability and cache
behavior attributes are not relevant to most microcontroller implementations. See
configuration for a microcontroller
and your vendor documentation for
programming guidelines if implemented.
Table 4-37 Memory attributes summary
Memory type
Shareability
Other attributes
Description
Strongly- ordered
-
-
All accesses to Strongly-ordered memory occur in program
order. All Strongly-ordered regions are assumed to be shared.
Device
Shared
-
Memory-mapped peripherals that several processors share.
Non-shared
-
Memory-mapped peripherals that only a single processor uses.
Normal
Shared
Non-cacheable
Write-through Cacheable
Write-back Cacheable
Normal memory that is shared between several processors.
Non-shared
Non-cacheable
Write-through Cacheable
Write-back Cacheable
Normal memory that only a single processor uses.