SAM-BA : Flashing taskit's ARM-based boards

Introduction

In order to avoid the need of a JTAG programmer for taskit's AT91-based and Cortex-A5 boards we offer an extension to Atmel's SAM-BA programming tool. It provides flashing via USB at much higher speed compared to a JTAG programmer. This article describes how to install and use this extension.

This article only deals with SAM-BA version 2.10, it is compatible with later version 2.12 as well. For information about older versions please refer to the article's history.

Note: The support package has been split into a 2.10 version containing Stamp9261/9G10/9G20/9G45, NanosG20, PortuxG20 - and a 2.12 version for StampA5.
Version 2.10 works with SAM-BA 2.12 but not for StampA5. StampA5 based products have to use SAM-BA 2.12 and only the 2.12 support package.

Requirements

  • SAM-BA version 2.10 or 2.12
  • USB connection

Installation

The extension consists of various scripts and ARM binaries in one ZIP archive. It can be found as attachment on the very bottom of this article. The content of this archive needs to be extracted into the SAM-BA installation directory. Furthermore the file "boards.tcl" requires some update. In order to do so, just add the following lines.

Support package 2.10 (Stamp9261/9G10/9G20/9G45, NanosG20, PortuxG20):

"at91sam9261-taskit"       "at91sam9261-taskit/taskit-9261.tcl"
"at91sam9g10-taskit"       "at91sam9g10-taskit/taskit-9g10.tcl"
"at91sam9g20-taskit"       "at91sam9g20-taskit/at91sam9g20-ek.tcl"
"at91sam9g45-taskit"       "at91sam9g45-taskit/at91sam9g45-ek.tcl"

Support package 2.12 (StampA5D36):

"at91sama5d3x-taskit"      "at91sama5d3x-taskit/at91sama5d3x-taskit.tcl"

Note: StampA5 should be flashed using SAM-BA 2.12 and the entry "at91sama5d3x-taskit".

Note: Since it is hard to get older versions of SAM-BA on Atmel's website, we provide a download of SAM-BA 2.10 and 2.12 for Linux and Windows.
SAM-BA 2.10:
http://download.armbedded.eu/tools/sam-ba-linux_2.10.zip
http://download.armbedded.eu/tools/sam-ba_2.10.exe
SAM-BA 2.12:
http://download.armbedded.eu/tools/sam-ba_2.12.zip
http://download.armbedded.eu/tools/sam-ba_2.12.exe

Usage

SAM-BA connects to a loader located in an internal ROM to interact with the device. The target device needs to be set up in order to run this internal loader. The following tables show how to enable SAM-BA access for several boards depending on the location that contains AT91bootstrap.

Bootcode is located in Flash:

Board Flash type Description
Panel-Card, Stamp9261 NOR Close BMS on Panel-Card Base before power up
Stamp9G20 NAND Close J3 before power up, remove after connect to SAM-BA; if plugged onto the EVB, use PIN1 and PIN38 of the bus interface instead
PortuxG20 NAND Close J3 before power up, remove after connect to SAM-BA
NanosG20 NAND Close J3 before power up, remove after connect to SAM-BA
Stamp9G45 NAND Close J3 before power up, remove after connect to SAM-BA
StampA5 NAND Close J3 before power up, remove after connect to SAM-BA

Bootcode is located in DataFlash:

Board SPI bus and CS Description
Stamp9G20 SPI0 CS1 Close J4 before power up, remove after connect to SAM-BA; if plugged onto the EVB, use PIN1 and PIN37 of the bus interface instead
NanosG20 SPI0 CS0 Close J14 before power up, remove after connect to SAM-BA
StampA5 SPI0 CS0 Close J2 before power up, remove after connect to SAM-BA

After connecting your board via USB, launch SAM-BA and choose at91sam9261-taskit for Panel-Card and Stamp9261, at91sam9g10-taskit for Stamp9g10, at91sam9g20-taskit for Portux9g20 and Stamp9g20. For Stamp9G45 choose at91sam9g45-taskit. StampA5 requires SAM-BA 2.12 and at91sama5d3x-taskit.

Programming NAND boards

Description:

Some boards run from NAND-Flash. The boot from NAND-Flash is executed before starting the internal ROM. That means, as long there is executable code at offset 0x0 on your NAND chip, the internal ROM-Bootloader will not start. To avoid this scenario, the chip select of the NAND-Flash (NCS3) needs to be disabled (see table above). According to this, temporarily disabling the DataFlash's chip select during startup is needed when AT91bootstrap is stored in DataFlash.

Next choose tab NandFlash and execute the script Enable NandFlash (cable / Jumper needs to be removed by now). Depending on the ECC algorithm that shall be used select either 4bit BCH or Hamming. If you have executable code at address 0x0, the NAND needs to be erased, use script erase ALL. This will erase the complete NAND, so you have to flash all images again.

Board Bootstrap 2nd stage loader Linux
Stamp9G20 0x00000 0x20000 (U-Uoot) 0xA0000
Stamp9G45 0x00000 0x60000 -
PortuxG20 0x00000 0x20000 (U-Boot) 0xA0000
NanosG20 0x00000 0x20000 -
StampA5 0x00000
Factory programming uses DataFlash for this.
- -

These are the addresses to flash your images to.

As an alternative, SAM-BA provides access to internal flash scripts via built-in TCL shell.

NANDFLASH::EraseBlocks [start] [end]

NANDFLASH::EraseBlocks will erase all blocks between [start] and [end]. Note that adresses in NANDFLASH start at 0 and that [end] means the highest address of the last block to be erased.

Note: Flash bootstrap (tab is still NandFlash) with the script Send Boot File and choose the bootstrap image.

AttachmentSize
SAM-BA_2.10-20141110.zip464.57 KB
SAM-BA_2.12-taskit-20151015.zip132.79 KB