Embedded Design Handbook

ID 683689
Date 8/28/2023
Public
Document Table of Contents

4.3.3.3. Region Layout Considerations

This section describes how to select MPU region locations and sizes to make the most effective use of the MPU. For information about the mechanics of setting up MPU regions, refer to “MPU Register Details” section.

Each region size must be an integer power of two. You must ensure that each region is aligned to an address that is an integer multiple of its size.

Figure 40. MPU Data Region Example (Addresses not to scale)

A low-priority exclusion region spans the entire 2 GB address space from 0x0 to 0x80000000.

Regions can overlap. For example, you can place a higher-priority region inside a lower-priority region. region[3] in mpu_utils.c illustrates this technique, creating a small exclusion region from 0x21000 to 0x21040, as shown in Figure 3. Any access to addresses in the 0x21000 to 0x21040 range is controlled by the exclusion region rather than the stack_ram region (region[4]), because the exclusion region has the higher priority.

Figure 41. MPU Instruction Region Example (Addresses not to scale)

A low-priority exclusion region spans the entire 2 GB address space from 0x0 to 0x80000000.