Atmel ARM-Based Evaluation Kit for SAM4S16C, 32-Bit ARM® Cortex® Microcontroller ATSAM4S-WPIR-RD ATSAM4S-WPIR-RD 데이터 시트

제품 코드
ATSAM4S-WPIR-RD
다운로드
페이지 1231
243
SAM4S Series [DATASHEET]
Atmel-11100G-ATARM-SAM4S-Datasheet_27-May-14
; 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
12.11.1.5Subregions
Regions of 256 bytes or more are divided into eight equal-sized subregions. Set the corresponding 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 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 
set to 0x00, otherwise the MPU behavior is unpredictable.
12.11.1.6Example 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:
Figure 12-13. SRD Use 
12.11.1.7MPU Design Hints And Tips
To avoid unexpected behavior, disable the interrupts before updating the attributes of a region that the interrupt 
handlers might access.
Ensure the software uses aligned accesses of the correct size to access MPU registers:
Except for the MPU_RASR, it must use aligned word accesses
For the MPU_RASR, it can use byte or aligned halfword or word accesses.
The processor does not support unaligned accesses to MPU registers.
When setting up the MPU, and if the MPU has previously been programmed, disable unused regions to prevent 
any previous region settings from affecting the new MPU setup.
MPU Configuration for a Microcontroller
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