AT91SAM9260-EK SAM-BA Recovery 1. Introduction AT91 ARM On the AT91SAM9260-EK revA board based on the 32-bit ARM Thumb based Thumb AT91SAM9260 microcontroller, both DataFlash and NAND Flash are present. After power up, the chip looks for a valid application in the DataFlash then in the Microcontrollers NANDFlash. If there is a wrong image programmed in NAND Flash or in DataFlash, the board can become non-responsive even to SAM-BA . Application Note There are three ways to solve the problem: Connect a DataFlash card containing a small application that erases the Flash correctly. Erase the Flash using a JTAG device. Remove resistors to disable the DataFlash and NAND Flash chip selects. To prevent an incorrect image from being programmed into the Flash memory, it is highly recommended to use the AT91Bootstrap application to setup the system after power up cycle. This application integrates a recovery procedure activated when BP4 button is pressed. 2. Boot Sequence on the AT91SAM9260-EK The Boot Program integrates different programs permitting download and/or upload into the different memories of the product. First, it initializes the Debug Unit serial port (DBGU) and the USB Device Port. Then the DataFlash Boot program is executed. It looks for a sequence of eight valid ARM exception vectors in a DataFlash connected to the SPI. All these vectors must be B-branch or LDR load register instructions except for the sixth vector. This vector is used to store the size of the image to download. If a valid sequence is found, code is downloaded into the internal SRAM. This is followed by a remap and a jump to the first address of the SRAM. If no valid ARM vector sequence is found, the DataFlash Boot program is executed on the second chip select. If no valid ARM vector sequence is found, NAND Flash Boot program is then executed. First, it looks for a boot.bin file in the root directory or in the FIRMWARE directory of a FAT12/16 formatted NAND Flash. If such a file is found, code is downloaded into the internal SRAM. This is followed by a remap and a jump to the first address of the SRAM. If the NAND Flash is not formatted, the NAND Flash 6281AATARM16-Nov-06 Boot program looks for a sequence of eight valid ARM exception vectors. If such a sequence is found, code is downloaded into the internal SRAM. This is followed by a remap and a jump to the first address of the SRAM. If no valid ARM vector sequence is found, SAM-BA Boot is then executed. It waits for transactions either on the USB device, or on the DBGU serial port. The AT91SAM9260 Boot ROM sequence is shown in Figure 2-1. Figure 2-1. Boot Program Algorithm Flow Diagram Start Yes Yes Internal RC Oscillator Main Oscillator Bypass No No Large Reduced Input Frequency Crystal Table Crystal Table Table Yes Download from SPI DataFlash Boot DataFlash Boot Run DataFlash (NPCS0) No Timeout < 1 s Yes Download from SPI DataFlash Boot DataFlash Boot Run DataFlash (NPCS1) No Timeout < 1 s Yes Download from NandFlash Boot NandFlash Boot Run NandFlash No Timeout 1 s Typ. Character(s) received Run SAM-BA Boot on DBGU OR SAM-BA Boot USB Enumeration Run SAM-BA Boot Successful 2 Application Note 6281AATARM16-Nov-06