ARM 7 & ARM 9 MICROCONTROLLERS AT91 1 AT91RM9200 Boot strategies.
-
Upload
kelly-wilcox -
Category
Documents
-
view
228 -
download
1
Transcript of ARM 7 & ARM 9 MICROCONTROLLERS AT91 1 AT91RM9200 Boot strategies.
®
ARM 7 & ARM 9 MICROCONTROLLERSAT91
1
AT91RM9200 Boot strategies
®
ARM 7 & ARM 9 MICROCONTROLLERSAT91
2
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)
®
ARM 7 & ARM 9 MICROCONTROLLERSAT91
3
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
®
ARM 7 & ARM 9 MICROCONTROLLERSAT91
4
Boot flow chart
®
ARM 7 & ARM 9 MICROCONTROLLERSAT91
5
Bootloader• Bootloader starts by looking for a valid program in the off-chip non-volatile memories
Dataflash through SPI EEPROM through TWI 8-bit memory device through EBI
Uploader
Valid program foundNo Yes
Program is loaded in SRAM and executed by branching at 0x0000_0000 after remap
®
ARM 7 & ARM 9 MICROCONTROLLERSAT91
6
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
Nb of 512 bytes blocks to download
ReservedNumber of pages
Dataflash page size
31 17 16 13 12 8 7 0
• The user must replace the sixth vector by its own vector
®
ARM 7 & ARM 9 MICROCONTROLLERSAT91
7
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
Internal ROM
Internal ROM
Internal SRAM
0x0020_0000
0x0000_0000 0x0000_0000
0x0010_0000Remap
®
ARM 7 & ARM 9 MICROCONTROLLERSAT91
8
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)
®
ARM 7 & ARM 9 MICROCONTROLLERSAT91
9
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
®
ARM 7 & ARM 9 MICROCONTROLLERSAT91
10
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
®
ARM 7 & ARM 9 MICROCONTROLLERSAT91
11
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.
®
ARM 7 & ARM 9 MICROCONTROLLERSAT91
12
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
®
ARM 7 & ARM 9 MICROCONTROLLERSAT91
13
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
Boot image24 KBytes
Free
Environment variables 8Kbytes
U-Boot gzippedimage
64 KBytes
0x10000000
0x10006000
0x1000E000
0x10010000
0x10020000
®
ARM 7 & ARM 9 MICROCONTROLLERSAT91
14
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 RAMand jumps to it
U-Boot
U-Boot Running
®
ARM 7 & ARM 9 MICROCONTROLLERSAT91
15
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