
DR
AFT
DR
AFT
DRAFT
DR
D
RAFT
DRAFT
DRA
FT DRAF
D
RAFT DRAFT DRAFT DRAFT DRAFT D
DRAFT
D
RAFT DRA
FT DRAFT DRAFT DRAFT DRA
UM10360_0
© NXP B.V. 2009. All rights reserved.
User manual
Rev. 00.06 — 5 June 2009
766 of 808
NXP Semiconductors
UM10360
Chapter 34: Appendix: Cortex-M3 User Guide
4.5.9 MPU 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 software uses aligned accesses of the correct size to access MPU registers:
•
except for the RASR, it must use aligned word accesses
•
for the 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.
4.5.9.1
MPU configuration for a microcontroller
Usually, a microcontroller system has only a single processor and no caches. In such a
system, program the MPU as follows:
In most microcontroller implementations, the shareability and cache policy attributes do
not affect the system behavior. However, using these settings for the MPU regions can
make the application code more portable. The values given are for typical situations. In
special systems, such as multiprocessor designs or designs with a separate DMA engine,
the shareability attribute might be important. In these cases refer to the recommendations
of the memory device manufacturer.
5HJLRQ
'LVDEOHGVXEUHJLRQ
'LVDEOHGVXEUHJLRQ
5HJLRQZLWK
VXEUHJLRQV
%DVHDGGUHVVRIERWKUHJLRQV
2IIVHWIURP
EDVHDGGUHVV
.%
.%
.%
.%
.%
.%
.%
.%
Table 662. Memory region attributes for a microcontroller
Memory region TEX
C
B
S
Memory type and attributes
Flash memory
b000
1
0
0
Normal memory, Non-shareable, write-through
Internal SRAM
b000
1
0
1
Normal memory, Shareable, write-through
External SRAM
b000
1
1
1
Normal memory, Shareable, write-back,
write-allocate
Peripherals
b000
0
1
1
Device memory, Shareable