Notes about SAM-BA Applet customization

An applet is a small program which is used by SAM-BA in order to be able to program non-volatile memories, low-level initialization, or other peripherals. For each Microchip AT91SAM device, there is one dedicated applet to each external memory device the chip can deal with. Each applet contains the programming algorithm for its dedicated memory. This article illustrates how to compile it to add new memory type or just to check the memory already implemented by the Microchip team.

I wrote this article as personal notes during my tests to add the 256MB QuadSPI flash avaiable on the RoadRunner Q256 module. More info about SAM-BA and te Applet are available from this Microchip doc:

These procedure has been tested on Linux Ubuntu version 16.04.2

The Atmel Software package

The SAMA5D2 software package consists of microcontroller drivers, software services and libraries. Each software module is provided with full source code, examples of usage, rich html documentation and ready-to-use projects for the GNU GCC and IAR EWARM compilers.

Clone the Atmel Software Package on your Linux PC:

$ git clone https://github.com/atmelcorp/atmel-software-package.git
$ cd atmel-software-package
$ git checkout tags/v2.5

Download the GNU ARM Embedded Toolchain for Linux:

Move to the Applet source directory you need to change:

$ cd samba_applets/qspiflash

Change this line for example (it will add the 256MByte QuadSPI used on RoadRunner Q256):

File drivers/memories/spi-nor.c row 69:

/* Roadrunner QuadSPI */
{ "MT25Q02G",    0x0022ba20, 256, 16 * 1024 * 1024, SPINOR_FLAG_ERASE_4K | SPINOR_FLAG_ERASE_64K | SPINOR_FLAG_QUAD | SPINOR_FLAG_FSR | SPINOR_FLAG_ENTER_4B_MODE },

Launch the Applet compilation:

$ make TARGET=sama5d2-generic RELEASE=1 CROSS_COMPILE=~/gcc-arm-none-eabi/bin/arm-none-eabi-

Copy the executable file to sam-ba directory where is located the old Applet binary file:

$ cp build/applet-qspiflash_sama5d2-generic_sram.bin  ~/roadrunner/sam-ba_3.1.4/qml/SAMBA/Device/SAMA5D2/applets

Links

Author:
Sergio Tanzilli - tanzilli@acmesystems.it
http://www.tanzilli.com - https://github.com/tanzilli