Presentation is loading. Please wait.

Presentation is loading. Please wait.

AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program.

Similar presentations


Presentation on theme: "AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program."— Presentation transcript:

1 AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program which allows to download application from external memories into internal SRAM.

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) The BMS pin state allows the AT91RM9200 to boot out of an internal or external boot memory, the input level on the BMS pin during the last 2 clock cycles, before the reset selects the type of boot memory. If high, the internal ROM which contents a Boot Program is selected. If low, the external memory is selected.

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 The Boot Program allows to download an application from external memory into SRAM. It integrates a Bootloader and a boot Uploader to assure correct information download.

4 Boot flow chart The Boot Program implements the algorithm presented in this figure.

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 Valid program found No Yes Uploader Program is loaded in SRAM and executed by branching at 0x0000_0000 after remap The Bootloader is activated first and looks for a sequence of eight valid ARM exceptions vectors in a DataFlash connected to the SPI, an EEPROM connected to the TWI or an 8-bit memory device connected to the EBI. If no valid ARM vector sequence is found, the Boot Uploader is started.

6 Nb of 512 bytes blocks to download
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 16 13 12 8 7 Number of pages Nb of 512 bytes blocks to download Dataflash page size Reserved The user must replace the sixth vector by its own vector The Bootloader software looks for a valid application by analyzing the first 32 bytes corresponding to the ARM exceptions vectors. These bytes must implement ARM instructions for either a branch or load PC with PC relative addressing. The sixth vector, at offset 0x18, contains the size of the image to download and the DataFlash parameters. The user must replace this vector with his own vector.

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 Remap 0x0020_0000 0x0010_0000 Internal ROM Internal SRAM 0x0000_0000 0x0000_0000

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 ,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) If no valid boot device has been found during the Bootloader sequence, initialization of serial communications devices (DBGU and USB device ports) is performed. Initialization of the DBGU ( bauds, 8, N, 1) and Xmodem protocol start, initialization of the USB Device Port and DFU protocol start, download of the application.

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 The DBGU sends the character "C" (0x43) to start an Xmodem protocol. Any terminal performing this protocol can be used to send the application file to the target. The Xmodem protocol supported is the 128-byte length block. This protocol uses a two character CRC-16 to guarantee detection of a maximum bit error. Xmodem protocol with CRC is accurate provided both sender and receiver report successful transmission. This figure shows a transmission using this protocol. ACK SOH 03 FC Data[100] CRC CRC ACK EOT ACK

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 A 48MHz USB clock is necessary to use USB Device Port. It has been programmed earlier in the device initialization. The DFU allows upgrade of the firmware of USB devices. The DFU algorithm is a part of the USB specification. USB reset Firmware execution

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. The Software and Hardware limitations of the Boot Program.

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 The U-Boot program is a standalone software application that initializes the AT91RM9200 processor and then jumps to the main application. If the user sends a character to the system console during the bootstrap, U-Boot enters interactive mode. The user is prompted to enter commands on the command line. The commands allow the processor to read/modify memory areas, set environment variables, download data from the serial port or from the Ethernet interface and execute code routines.

13 Environment variables 8Kbytes
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 0x Boot image 24 KBytes 0x Free U-Boot is made up of three parts: A primary bootstrap, a de-compression executable, a gzip-compressed binary executable which is called the U-Boot Image. The primary bootstrap is concatenated to the de-compression executable into one single file called the boot image. The primary bootstrap is a simple assembly code routine that sets up the system and puts it into an operational state. 0x1000E000 Environment variables 8Kbytes 0x U-Boot gzipped image 64 KBytes 0x

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 RAM and jumps to it U-Boot U-Boot Running

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 Main features of the U-Boot software for the AT91RM9200.


Download ppt "AT91RM9200 Boot strategies This training module describes the boot strategies on the AT91RM9200 including the internal Boot ROM and the U-Boot program."

Similar presentations


Ads by Google