; R1 = address and region number in one
; R2 = size and attributes in one
LDR R0, =MPUBASE ; 0xE000ED9C, MPU Region Base register
STR R1, [R0, #0x0] ; Region base address and region number combined
; with VALID (bit 4) set
STR R2, [R0, #0x4] ; Region Attribute, Size and Enable
Subregions
Regions of 256 bytes or more are divided into eight equal-sized subregions. Set the corresponding
bit in the
SRD
field of the
MPU Region Attribute and Size (MPUATTR)
register (see page 199) to
disable a subregion. The least-significant bit of the
SRD
field controls the first subregion, and the
most-significant bit controls the last subregion. Disabling a subregion means another region
overlapping the disabled range matches instead. If no other enabled region overlaps the disabled
subregion, the MPU issues a fault.
Regions of 32, 64, and 128 bytes do not support subregions. With regions of these sizes, the
SRD
field must be configured to
0x00
, otherwise the MPU behavior is unpredictable.
Example of SRD Use
Two regions with the same base address overlap. Region one is 128 KB, and region two is 512 KB.
To ensure the attributes from region one apply to the first 128 KB region, configure the
SRD
field for
region two to 0x03 to disable the first two subregions, as Figure 3-1 on page 140 shows.
Figure 3-1. SRD Use Example
Region 1
Disabled subregion
Disabled subregion
Region 2, with
subregions
Base address of both regions
Offset from
base address
0
64KB
128KB
192KB
256KB
320KB
384KB
448KB
512KB
3.1.4.2
MPU Access Permission Attributes
The access permission bits,
TEX
,
S
,
C
,
B
,
AP
, and
XN
of the
MPUATTR
register, control access to
the corresponding memory region. If an access is made to an area of memory without the required
permissions, then the MPU generates a permission fault.
Table 3-3 on page 140 shows the encodings for the
TEX
,
C
,
B
, and
S
access permission bits. All
encodings are shown for completeness, however the current implementation of the Cortex-M4 does
not support the concept of cacheability or shareability. Refer to the section called “MPU Configuration
for a Tiva™ C Series Microcontroller” on page 142 for information on programming the MPU for
TM4C1294NCPDT implementations.
Table 3-3. TEX, S, C, and B Bit Field Encoding
Other Attributes
Shareability
Memory Type
B
C
S
TEX
-
Shareable
Strongly Ordered
0
0
x
a
000b
-
Shareable
Device
1
0
x
a
000
June 18, 2014
140
Texas Instruments-Production Data
Cortex-M4 Peripherals