SAM-BA is freely downloadable in two versions:
In this article we refer to the command line version that is the only version compatible with the QuadSPI memory used on the RoadRunner module. We will illustrate the use of the Linux version but probably the Windows version will work in the same way.
Open the SAM-BA web site and download the package: SAM-BA 3.2.1 for Linux.
Uncompress the tar.gz file:
tar xvf sam-ba_3.2.1-linux_x86_64.tar
Download and save, inside the directory just created by tar, this file:
This is a script file written in QML that gives the istructions to SAM-BA on how and what tranfer inside the QuadSPI memory and much more.
More info about the QML function are available in: doc/index.html.
SAM-BA can be used only when on the MCU is running RomBOOT. When the CPU is running other codes like at91bootstrap, uboot or linux it is not usable because it talk only with RomBOOT.
RomBOOT is the first piece of code running on the MCU at startup. It is burned directly by Microchip factory inside the ROM MPU. At startup RomBOOT looks for a bootable code from any possible supported external memory, if nothing is available, it waits for any serial commands incoming from the USB device port or from the serial debug port. This is the way used by SAM-BA to talk with RomBOOT.
The RoadRunner with QuadSPI on board (Model Q16/Q64/Q128) are already programmed to boot from QuadSPI. The default code put on it is at91bootstrap.
In case you want to reflash it just press the push-button BOOTOFF on the Berta D2 board and then press and release after one second the RESET button to restart the MPU. Then release the BOOTOFF pushbutton.
In this situation the RoadRunner MPU is inhibited to boot from the QuadSPI, it remains in RomBoot mode and a new USB device is announced on the USB port of your PC:
$ lsusb ... Bus 002 Device 004: ID <b>03eb:6124 Atmel Corp. at91sam SAMBA bootloader</b> ...
and a new serial device is available with the name /dev/ttyACM0:
$ dmesg ... [ 4676.045662] cdc_acm 2-2.1:1.0: ttyACM0: USB ACM device [ 4676.046800] usbcore: registered new interface driver cdc_acm [ 4676.046803] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters ... $ ls -al /dev/ttyACM0 crw-rw---- 1 root dialout 166, 0 Aug 2 12:53 /dev/ttyACM0
The device name /dev/ttyACM0 is used inside roadrunner.qml script.
Save the at91bootstrap.bin file inside the SAM-BA directory and launch SAM-BA with this command:
sudo ./sam-ba -x roadrunner.qml
Messages send by the Appletson the debug port writing the QuadSPI memory.
Applet 'QSPI Flash' from softpack 2.10 (v2.10). Initializing QSPI0 IOSet3 at 66000000Hz Found Device n25q128ax3 Size: 16777216 bytes Page Size: 256 bytes Buffer Address: 0x00229b40 Buffer Size: 91136 bytes QSPI applet initialized successfully
Applet 'QSPI Flash' from softpack 2.10 (v2.10). Initializing QSPI0 IOSet3 at 66000000Hz Found Device n25q512ax3 Size: 67108864 bytes Page Size: 256 bytes Buffer Address: 0x00229b40 Buffer Size: 91136 bytes QSPI applet initialized successfully
Applet 'QSPI Flash' from softpack 2.12 (v2.12-dirty). Initializing QSPI0 IOSet3 at 122000000Hz Found Device mt25q02G Size: 268435456 bytes Page Size: 256 bytes Buffer Address: 0x00229cc0 Buffer Size: 90880 bytes QSPI applet initialized successfully.
dd bs=1K count=64 < /dev/urandom > test64KB.bin dd bs=1M count=16 < /dev/urandom > test16MB.bin dd bs=1M count=64 < /dev/urandom > test64MB.bin dd bs=1M count=256 < /dev/urandom > test256MB.bin