csp_apps_sam_9x60

MCHP

Using at91boostrap loader with Harmony3 MPU applications

MPU harmony3 applications are compiled and linked to execute from external DRAM memory that is available on the corresponding evaluation kit. This require all peripherals and clock leading to the DRAM memory to be configured prior to the application being programmed into DRAM. This is achieved using a bootstrap loader. We use AT91bootstrap loader for this purpose.

We have deployed the following pre-built bootstrap binaries inside our application repositories. They can be found under deps folder at the root of the repository.

Binary Name Description
at91bootstrap.elf Bootstrap which allows debug or run application using MPLABx
boot.bin Bootstrap which allows booting application using an SD Card

To use at91boostrap to load and run harmony applications from MPLABx, it should be build with “bkpt_none_defconfig” configuration. If you are intrested in building at91bootstrap using MPLABx, you can read about it here.

Configure a debug tool

Configure bootstrap

Run/Debug MPU applications using MPLABx

You can now Run/Debug the MPU application just like any other MPLABx applications. When executed, MPLABx performs a two stage loading:

Stage 1: Loads the bootstrap loader into the internal SRAM and executes it. This will configure the board specific peripherals and memory

Stage 2: Loads the application into the external DRAM and debugs it. User can perform actions like setting breakpoints, single-stepping etc.

When using MPLABx to debug a harmony application, you will face the following limitations:

Boot to application using SD card

Copy both the application binary named “harmony.bin” and the bootstrap binary named “boot.bin” onto an SD card. Insert the SD card into the SD slot of the evaluation kit and press the reset button.

The ROM bootloader will copy the bootstrap binary “boot.bin” into the internal SRAM and executes it. The bootstrap will configure the external DRAM and the required peripherals, then copy the applicaton binary “harmony.bin” into the DRAM and executes it.