AVR32 - Memory Protection Unit Driver Documentation
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 operating mode:
- The example starts by displaying the number of MPU entries.
- The memory areas are then set up in the following manner:
Access permissions of used memory areas
| 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 => LED3 lights up.
- The application then calls a function in Region 0/Subregion 12. That triggers an ITLB protection exception => LED2 lights up.
- End of example: LED0 & LED1 alternatively blink forever.
- mpu.c: MPU driver;
- mpu.h: MPU driver header file;
- mpu_example.c: MPU example .
- mpu_exception.S: asm file for exception support (GCC)
- mpu_exception.s82: asm file for exception support and declaration of function specially located (IAR)
This software was written for the GNU GCC for AVR32 and IAR Systems compiler for AVR32. Other compilers may or may not work.
This example has been tested with the following configuration:
- EVK1100, EVK1101, EVK1104, EVK1105 evalutation kit, STK600+RCUC3L0 routing card;
- CPU clock: 12 MHz; for the STK600+RCUC3L0 setup, plug a 12MHz crystal in the crystal socket (near the PROGRAM button) and switch the CLOCK selector to XTAL.
- USART1 (on EVK1100 or EVK1101) connected to a PC serial port via a standard RS232 DB9 cable, or USART0 (on EVK1105) or USART1 (on EVK1104) abstracted with a USB CDC connection to a PC; STK600 usart port for the STK600+RCUC3L setup (connect STK600.PE2 to STK600.RS232 SPARE.TXD and STK600.PE3 to STK600.RS232 SPARE.RXD)
- STK600 LEDs for the STK600+RCUC3L setup, apply the following connections:
- STK600.PORTA.PA4 -> STK600.LEDS.LED0
- STK600.PORTA.PA5 -> STK600.LEDS.LED1
- STK600.PORTA.PA6 -> STK600.LEDS.LED2
- STK600.PORTA.PA7 -> STK600.LEDS.LED3
- STK600.PORTA.PB0 -> STK600.LEDS.LED4
- STK600.PORTA.PB1 -> STK600.LEDS.LED5
- STK600.PORTA.PB2 -> STK600.LEDS.LED6
- STK600.PORTA.PB3 -> STK600.LEDS.LED7
- PC terminal settings:
- 57600 bps,
- 8 data bits,
- no parity bit,
- 1 stop bit,
- no flow control.
For further information, visit
Atmel AVR32.
Support and FAQ:
http://support.atmel.no/