AT91 Sales Presentation 0102

Download Report

Transcript AT91 Sales Presentation 0102

AT91 ARM 7 & ARM 9
MICROCONTROLLERS
®
AT91RM9200 Boot strategies
1
AT91 ARM 7 & ARM 9
MICROCONTROLLERS
®
Boot strategies
•
BMS allows AT91RM9200 to boot from two different
sources
 Embedded boot ROM (BMS high)
 Boot program which integrates
 Bootloader
 Uploader
 Flash
 Primary bootstrap and de-compression code are run
in the flash
 De-compression code de-compresses Uboot in
SDRAM and jumps to it. (see Uboot slides)
2
AT91 ARM 7 & ARM 9
MICROCONTROLLERS
®
Boot program
•
Boot program features
 Default boot program stored in ROM-based products
 Downloads and runs application from external storage
media into SRAM
 Automatic detection of valid application
 support a wide range of non-volatile memories
 SPI Dataflash
 TWI EEPROM
 8-bit parallel memories through EBI
3
AT91 ARM 7 & ARM 9
MICROCONTROLLERS
®
Boot flow chart
4
AT91 ARM 7 & ARM 9
MICROCONTROLLERS
®
Bootloader
•
Bootloader starts by looking for a valid program in the offchip non-volatile memories
 Dataflash through SPI
 EEPROM through TWI
 8-bit memory device through EBI
Valid program found
No
Uploader
Yes
Program is loaded in SRAM
and executed by branching
at 0x0000_0000 after remap
5
AT91 ARM 7 & ARM 9
MICROCONTROLLERS
®
Vector analysis
•
Bootloader checks the first 32 bytes of the ARM exception
vector. These bytes should implement
 A branch
 A load PC with PC relative addressing
• The sixth vector structure
31
17
Dataflash page size
•
16
13
Number of
pages
12
Reserved
8
7
0
Nb of 512 bytes
blocks to download
The user must replace the sixth vector by its own vector
6
AT91 ARM 7 & ARM 9
MICROCONTROLLERS
®
SRAM remap
•
After reset, the code in internal ROM is mapped at both
addresses 0x0000_0000 and 0x0010_0000
• Remap action is performed after download completion
Internal
SRAM
0x0020_0000
Internal
ROM
0x0000_0000
Remap
Internal
ROM
0x0010_0000
Internal
SRAM
0x0000_0000
7
AT91 ARM 7 & ARM 9
MICROCONTROLLERS
®
Uploader
•
The boot Uploader performs the DFU and Xmodem transfer
to upload the application in SRAM at address 0x0020_0000
• DBGU Serial Port
 Uploader initializes the DBGU serial port at 115200,8,n,1
 The application is downloaded through Xmodem protocol
 The size of the application should be less than SRAM size
(3KB)
• DFU : Device Firmware Upgrade
 DFU protocol allows the firmware update of USB devices
 The application is downloaded in SRAM at address
0x0020_0000
• The Application’s size should be less than SRAM size
(3KB)
8
AT91 ARM 7 & ARM 9
MICROCONTROLLERS
®
Xmodem protocol
The DBGU sends character ‘C’ to start an Xmodem
protocol
• The Xmodem protocol supported is the 128-byte long block
• Xmodem protocol uses two character CRC-16 to detect a
maximum of bit error
•
Host
device
C
SOH 01 FE Data[128] CRC CRC
ACK
SOH 02 FD Data[128] CRC CRC
ACK
SOH 03 FC Data[100] CRC CRC
ACK
EOT
ACK
9
AT91 ARM 7 & ARM 9
MICROCONTROLLERS
®
DFU protocol
•
DFU protocol upgrades firmware through USB devices
• A 48 MHz USB clock is set during the device initialization
Host
device
Prepare for an upgrade
USB reset
DFU mode activated
Download this firmware
Prepare to exit DFU mode
USB reset
Firmware
execution
10
AT91 ARM 7 & ARM 9
MICROCONTROLLERS
®
Boot program limitations
•
The download code must be less than the SRAM size 3KB
• The EEPROM device address must be 0 on the TWI bus
• The code is always downloaded from device address
0x0000_0000 to the address 0x0000_0000 of the SRAM after
remap
• The downloaded code must be position-independent or
linked at address 0x0000_0000.
11
AT91 ARM 7 & ARM 9
MICROCONTROLLERS
®
Boot solutions
• U-Boot overview
 Standalone software that initializes AT91RM92000
processor and displays a prompt for an interactive mode
 The user is prompted to enter commands
 It offers a set of commands that allows to do :
 Read/modify memory areas
 Set environmental variables
 Download data from serial port or from Ethernet
interface
12
AT91 ARM 7 & ARM 9
MICROCONTROLLERS
®
Uboot Layers
• U-Boot is made of two programs that reside in the flash
 Boot image
 Primary bootstrap
 De-compression executable
 U-Boot gzipped image
0x10000000
Boot image
24 KBytes
0x10006000
Free
0x1000E000
0x10010000
Environment variables 8Kbytes
U-Boot
gzipped
image
64 KBytes
0x10020000
13
AT91 ARM 7 & ARM 9
MICROCONTROLLERS
®
Uboot Launching sequence
Primary bootstrap
(Assembly code)
Starts high-speed clocks for CPU
Programs the on-chip memory
controller to define the memory layout
De-compression
De-compresses U-Boot in RAM
and jumps to it
U-Boot
U-Boot Running
14
AT91 ARM 7 & ARM 9
MICROCONTROLLERS
®
Boot solutions
• U-Boot features
 Standalone primary boot
 OS independent
 Autoboot and interactive mode
 Command line interface
 Non volatile environmental variables
 Flash programming capability
 Download through serial port (Kermit protocol)
 Download through Ethernet (tftp)
 Scripting capability
15