Compile a SAM-BA Applets

An applet is a small program which is used by SAM-BA in order to program non-volatile memories, low-level initialization, or other peripherals wired o Microchip AVR and ARM MPUs. This article describes how to compile the applet code.

Installing the Microchip Software Package on your Linux PC

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.

Create a working directory on your home called roadrunner:

mkdir roadrunner
cd roadrunner

Get start cloning the patched Microchip Software Package from GitHub repository by typing:

sudo apt update
sudo apt install git make
git clone --single-branch --branch acme https://github.com/AcmeSystems/atmel-software-package.git 
cd atmel-software-package

This version include a patch to be able to write the QuadSPI at 64MB and 128MB mounted on some model of Roadrunner SOM (Many thanks to Ramok for this patch https://github.com/atmelcorp/atmel-software-package/issues/64).

Download the GNU ARM Embedded Toolchain for Linux 64-bit version 7-2018-q2-update:

wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/7-2018q2/gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2
tar xvf gcc-arm-none-eabi-7-2018-q2-update-linux.tar.bz2

Launch the Applet compilation

Move inside the directory where is the source of the Applet you need to compile:

cd samba_applets/qspiflash

Launch the Applet compilation:

make TARGET=sama5d2-generic RELEASE=1 CROSS_COMPILE=~/roadrunner/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi-

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

cp build/sama5d2-generic/sram/applet-qspiflash_sama5d2-generic_sram.bin  ~/roadrunner/sam-ba_3.3.1/qml/SAMBA/Device/SAMA5D2/applets

If SAM-BA is not yet installed on your PC follow this article:

Links

Notes

Set the trace level debug

Five level of debug messages are available (https://github.com/atmelcorp/atmel-software-package/blob/master/utils/trace.h#L35)

/// !Trace level description
/// -# TRACE_DEBUG (5): Traces whose only purpose is for debugging the program, 
///    and which do not produce meaningful information otherwise.
/// -# TRACE_INFO (4): Informational trace about the program execution. Should  
///    enable the user to see the execution flow.
/// -# TRACE_WARNING (3): Indicates that a minor error has happened. In most case
///    it can be discarded safely; it may even be expected.
/// -# TRACE_ERROR (2): Indicates an error which may not stop the program execution, 
///    but which indicates there is a problem with the code.
/// -# TRACE_FATAL (1): Indicates a major error which prevents the program from going
///    any further.

To set the TRACE_LEVEL variable when launch make try for example:

make TARGET=sama5d2-generic RELEASE=1 CROSS_COMPILE=~/roadrunner/gcc-arm-none-eabi-7-2018-q2-update/bin/arm-none-eabi- TRACE_LEVEL=5

More info about this article

  • Last update: 1 May 2020
  • Host PC used: Linux Ubuntu 64 ver 18.04.4 LTS
  • Cross compiler used: arm-linux-gnueabihf-gcc (GNU Tools for Arm Embedded Processors 7-2018-q2-update)
  • Boards used: ROADRUNNER-Q16/64/128, BERTA-D2


Sergio Tanzilli
Systems designer, webmaster of www.acmesystems.it and founder of Acme Systems srl

Personal email: tanzilli@acmesystems.it
Web pages: https://www.acmesystems.it --- https://www.acmestudio.it
Github repositories: https://github.com/tanzilli --- https://github.com/acmesystems
Telegram group dedicated to the Acme Systems boards: https://t.me/acmesystemssrl