Introduction
This is the documentation for the data structures, functions, variables, defines, enums, and typedefs for the SAU driver.
It also gives an example of the usage of the SAU module.
The SAU allows the user to remap registers in memory regions protected by the MPU to regions not protected by the MPU. The MPU is set up to protect regions of memory, while the SAU is set up to provide a secure channel into specific memory locations that are protected by the MPU.
Example operating mode:
- The example starts by remapping the SAU HSB address to the USART registers.
- In open mode, SAU can be mapped and accessed directly
- The interruption will be then triggered by :
- Attempting to read Unlock Register
- In lock mode, the interruption will be then triggered by
- Attempting to write the Unlock register with an invalid key
- The exception will be then triggered by :
- Attempting to read Unlock Register
- Attempting to access the locked channel without unlocking first
- The memory areas are then set up by MPU in the following manner:
Access permissions of used memory areas
| Access Permissions |
Flash [0x80000000 - 0x80010000], Region 0, all subregions | Read / Write |
Stack [&stack - &stack + stack size], Region 1, all subregions | Read / Write |
SAU HSB [0x90000000 - 0x9001000], Region 2, all subregions | Read / None |
PBA memory [0xFFFF0000 - 0xFFFFF800], Region 3, all subregions | Read / None |
PBA memory [0xFFFE0000 - 0xFFFF0000], Region 4, subregions 4/5 | Read / None |
- The application then performs a write access to SAU slave address, which is mapped to USART operation and caused the output from USART.
- The application then performs a directly write to the USART. since is was protected by MPU, it triggers a DTLB write protection exception => LED3 lights up.
- End of example: LED0 & LED1 alternatively blink forever.
Main Files
- sau.c: SAU driver;
- sau.h: SAU driver header file;
- sau_example.c: SAU example .
- sau_exception.S: asm file for exception support (GCC)
- sau_exception.s82: asm file for exception support and declaration of function specially located (IAR)
Compilation Info
This software was written for the GNU GCC for AVR UC3 and IAR Systems compiler for AVR UC3. Other compilers may or may not work.
Information
This example has been tested with the following configuration:
- UC3C_EK, UC3L_EK;
- USART2 (on UC3C_EK) or USART3 (on UC3L_EK) abstracted with a USB CDC connection to a PC;
- PC terminal settings:
- 57600 bps,
- 8 data bits,
- no parity bit,
- 1 stop bit,
- no flow control.
Contact Information
For further information, visit Atmel AVR UC3.
Support and FAQ: https://www.microchip.com/support/