AT91Bootstrap
Introduction
AT91Bootstrap is a first step bootloader providing a set of algorithms to manage hardware initialization (GPIO, Clock, SDRAM, etc), to download your main application from specified FLASH media to main memory and to start it.
In the linux4SAM pre-built demo it is used to configure the hardware and to load and start the standard
U-Boot bootloader, it can also be configured to start directly the linux kernel.
More information see
the AT91Bootstrap application note.
Pre-built binaries
DataFlash
NandFlash
This section describes How to load
AT91Bootstrap into the boot media with
SAM-BA.
- Connect the USB Device Interface to your host machine using the USB Device Cable
- Make sure that the chip can execute the bootROM monitor SAM-BA-boot :
| AT91SAM9260-EK | AT91SAM9261-EK | AT91SAM9263-EK (RevA) |
- J7 must be opened (BMS=1) to boot from the on-chip Boot ROM
- follow the AT91SAM9260EKSamBaRecovery recovery method, if needed
- power up the board
- verify that the USB connection is established (ATMEL AT91xxxxx Test Board appears in taskbar notification area)
| - J4 must be opened (BMS=1) to boot from the on-chip Boot ROM
- remove DataFlash Jumper (J21)
- power up the board
- verify that the USB connection is established (ATMEL AT91xxxxx Test Board appears in taskbar notification area)
- plug DataFlash Jumper (J21) back in position 1-2
| - J5-6 must be opened (BMS=1) to boot from the on-chip Boot ROM
- remove DataFlash Card (J9)
- power up the board
- verify that the USB connection is established (ATMEL AT91xxxxx Test Board appears in taskbar notification area)
- reinsert the DataFlash Card in J9
|
| AT91SAM9XE-EK | AT91SAM9RL-EK | AT91SAM9263-EK (RevB) |
- erase the content of the internal FLASH by putting the J7 jumper in position 1-2
- power up the board
- verify that the USB connection is established (ATMEL AT91xxxxx Test Board appears in taskbar notification area)
- open now J7 (or put in position 2-3), to boot in normal operating mode
| - J11 must be on 1-2 position (BMS=1) to boot from the on-chip Boot ROM
- remove DataFlash and NAND Flash Jumpers (J12 & J13)
- power up the board
- verify that the USB connection is established (ATMEL AT91xxxxx Test Board appears in taskbar notification area)
- close DataFlash and NAND Flash Jumpers (J12 & J13)
| - J5-6 must be opened (BMS=1) to boot from the on-chip Boot ROM
- remove DataFlash Card (J9)
- remove NAND Flash Jumpers (J29)
- power up the board
- verify that the USB connection is established (ATMEL AT91xxxxx Test Board appears in taskbar notification area)
- reinsert the DataFlash Card in J9 (only for DataFlash demo)
- close NAND Flash Jumper (J29)
|
- Start SAM-BA GUI Application
- Select the the board in the drop-down menu and choose the USB Connection

- Eventually plug back a jumper to access the media on which u-boot must be loaded to
- In the main SAM-BA window :
- Choose the proper media tab (DataFlash, NandFlash, etc.) in the SAM-BA GUI interface
- Initialize the media choosing the Enable action in the Scripts rolling menu and press Execute
- Choose Send boot file, press Execute
- Select the at91bootstrap binary file and press Open ; the media is written down
- Close SAM-BA, remove the USB cable
Boot strategies
AT91 chips embed a boot ROM code. It is enabled depending on BMS (Boot Mode Select) pin state on reset.
This ROM code scans the contents of different media like SPI DATAFLASH, NAND FLASH or SDCARD to determine if a valid application is available then it download the application into SAM9 internal SRAM and run it.
To determine if a valid application is present the ROM code checks the eight ARM exception vectors.
If no application is available then SAM-BA application is executed. It waits for transactions either on the USB device, or on the DBGU serial port, Then the
SAM-BA tool can be used to program FLASH or EEPROM present on your board.
For more information on this topic, please check the corresponding SAM product datasheet section
Boot Program . You can find a valuable summary in the document named
SAM9 Boot Strategies or see the cross matrix below..
ROM Code boot Sequence example
Boot capabilities matrix
Here is :

a summary of the boot feature for each board

the solution chosen for the Linux4SAM pre-built binaries.
| Product | Boot from DataFlash (SPI0 CS0) | Boot from DataFlash (SPI0 CS1) | Boot from NAND Flash | Boot from SD card | Boot from NOR Flash | Boot from Internal Flash 1 |
| at91rm9200ek | | | | | | |
| at91sam9260ek | | 2 | 3 | | | |
| at91sam9xeek | | | | | | |
| at91sam9261ek | 2 | | | | | |
| at91sam9263ek | 4 | | 5 | 5 | | |
| at91sam9rlek | 2 | | | | | |
The Dataflash version of
AT91Bootstrap will load a second level bootloader or application from the address 0x8000.
Dataflash memories have page size of 1056 bytes, (0x420 hex) and the load address 0x8000 is thus in the middle of a page.
Sources and build process are described in the
AT91Bootstrap application note page on
http://www.atmel.com .
You can also retrieve them from
ftp://www.linux4sam.org/pub/at91bootstrap .
A rewritten version of AT91bootstrap which fixes the page boundary problem
and also supports some other options is available
as part of the buildroot project at
http://buildroot.uclibc.org/
In brief
To compile an
AT91Bootstrap project:
- go into the board directory
- select your board by going into the corresponding board directory
- select your media by going into the corresponding directory
- run make
Example:
To compile a DataFlash boot project for AT91SAM9260-EK board, type the following commands:
cd board/at91sam9260ek/dataflash
make clean
and
make
or if you want to specify the cross-compiler :
make CROSS_COMPILE=<path_to_cross-compiler/cross-compiler-prefix->
path_to_cross-compiler is only needed if it is not in your
PATH.
Usually
cross-compiler-prefix- looks like
arm-linux- or
arm-elf-
Notes
1: Only available on products with embedded Flash
2: On board DataFlash chip
3: Please check at91sam9260 errata # 44.2.1.1
4: Removable DataFlash card
5: Supported on SAM9263 rev B and above