Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
MPU Example 1 for AT32UC3A0512 in AVR Simulator Documentation

Introduction

This is the documentation for the data structures, functions, variables, defines, enums, and typedefs for the MPU driver.
It also gives an example of the usage of the MPU module.

The MPU allows the user to divide the memory space into different protection regions. These regions have a user-defined size and start at a user-defined address. The different regions can have different access privileges attributes.

You can also read the Memory Protection Unit section in the AVR32 UC technical reference guide.

Example Description

  • The memory areas are set up in the following manner:
    Access permissions of used memory areas
    Memory Range Access Permissions
    RAM [0x00000000 - 0x00000F00[, Region 1, subregions 0 to 14 Read / Write
    RAM [0x00000F00 - 0x00001000[, Region 1, subregion 15 Read
    Stack [&stack - &stack + stack size[, Region 2, all subregions Read / Write
    Flash [0x80000000 - 0x8000C000[, Region 0, subregions 0 to 11 Read / eXecute
    Flash [0x8000C000 - 0x80010000[, Region 0, subregions 12 to 15 Read
    PBA memory map[0xFFFF0000 - 0xFFFFFFFF], Region 3, all subregions Read / Write
  • The application then performs a write access to Region 1/subregion 15. That triggers a DTLB write protection exception => MPU_STATE changes to DTLB_WRITE_EXCEPTION.
  • The application then calls a function in Region 0/Subregion 12. That triggers an ITLB protection exception => MPU_STATE changes to ITLB_PROTECTION_EXCEPTION.
  • End of example: CPU enters infinite loop

Main Files

Compilation Info

This software was written for the GCC for AVR32 for AVR32 Other compilers may or may not work.

Information

This example has been tested with the following configuration:

  • AVR Simulator
  • CPU clock: Internal RC Oscillator

Contact Information

For further information, visit Atmel AVR32.