229
11100B–ATARM–31-Jul-12
SAM4S Series [Preliminary]
Use an STM instruction to optimize this:
; R1 = region number
; R2 = address
; R3 = size, attributes in one
LDR R0, =MPU_RNR
; 0xE000ED98, MPU region number register
STM R0, {R1-R3}
; Region Number, address, attribute, size and enable
This can be done in two words for pre-packed information. This means that the MPU_RBAR
contains the required region number and had the VALID bit set to 1. See
. Use this when the data is statically packed, for example in a boot loader:
; R1 = address and region number in one
; R2 = size and attributes in one
LDR R0, =MPU_RBAR
; 0xE000ED9C, MPU Region Base register
STR R1, [R0, #0x0]
; Region base address and
; region number combined with VALID (bit 4) set to 1
STR R2, [R0, #0x4]
; Region Attribute, Size and Enable
Use an STM instruction to optimize this:
; R1 = address and region number in one
; R2 = size and attributes in one
LDR R0,=MPU_RBAR
; 0xE000ED9C, MPU Region Base register
STM R0, {R1-R2}
; Region base address, region number and VALID bit,
; and Region Attribute, Size and Enable
11.11.1.5
Subregions
Regions of 256 bytes or more are divided into eight equal-sized subregions. Set the correspond-
ing bit in the SRD field of the MPU_RASR field to disable a subregion. See
. The least significant bit of SRD 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 dis-
abled subregion, the MPU issues a fault.
Regions of 32, 64, and 128 bytes do not support subregions. With regions of these sizes, the
SRD fieldmust be set to 0x00, otherwise the MPU behavior is unpredictable.
11.11.1.6
Example of SRD Use
Two regions with the same base address overlap. Region 1 is 128 KB, and region 2 is 512 KB.
To ensure the attributes from region 1 apply to the first 128 KB region, set the SRD field for
region 2 to b00000011 to disable the first two subregions, as in
below:
Summary of Contents for SAM4S Series
Page 44: ...44 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 412: ...412 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 1105: ...1105 11100B ATARM 31 Jul 12 SAM4S Series Preliminary ...
Page 1143: ...1143 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 4 64 lead LQFP Package Drawing ...
Page 1145: ...1145 11100B ATARM 31 Jul 12 SAM4S Series Preliminary Figure 43 5 64 lead QFN Package Drawing ...