SAMA5D29-Curiosity – Configure and Build at91bootstrap to Load a MPLAB® Harmony v3 Application from SD Memory Card
Introduction
This training topic describes how to download, configure, and build at91bootstrap to load an MPLAB® Harmony v3 Software Framework application binary image (harmony.bin) from SD memory card to DDR2 SDRAM on the SAMA5D29-Curiosity Development Board using the MPLAB X Integrated Development Environment (IDE).
Once at91bootstrap has been built, the resulting binary image (boot.bin) can be copied to SD memory card.
Prerequisites
- MPLAB X IDE Installed on the host computer
- MPLAB XC32 Compiler installed on the host computer
Secure Digital Multimedia Card (SDMMC)
The SAMA5D29-Curiosity has two Secure Digital (SD) memory card slots:
- Secure Digital Multimedia Card (SD/MMC) (J7) – J7 is a Secure Digital (SD) or MultiMediaCard (MMC) memory card slot. It is connected to the SD MMC port 1 (SDMMC1) peripheral of the SAMA5D29.
- Micro Secure Digital (J6) (Bottom Side) – J6 is a microSD memory card slot mounted on the bottom side of the development board. It is connected to the SD MMC port 0 (SDMMC0) peripheral of the SAMA5D29.
Download at91bootstrap
Create a Project Directory.
For the purposes of this training, we’ll name our project directory "at91bootstrap".
Download or clone at91bootstrap version 4.
Download or clone from the Linux4sam GitHub repository.
Open Project at91bootstrap
From MPLAB X IDE, select File > Open Project…
An Open Project dialog is displayed.
Click on the Open Project button.
The at91bootstrap project will be displayed in the Projects pane (upper left) and in the at91bootstrap – Dashboard pane (bottom left).
Configure at91bootstrap Project Properties
Open at91bootstrap Project Properties.
Open the at91bootstrap Project Properties using one of the following methods:
- In the Projects pane, highlight at91bootstrap and click on the wrench icon in the at91bootstrap - Dashboard.
- In the Projects pane, right-click on at91bootstrap and select Properties from the menu.
The Projects Properties – at91bootstrap dialog box opens.
Configure the MPLAB XC32 Compiler.
In the Categories pane, select Makefile.
Enter the following text in the Build command and Debug build command boxes:
make CROSS_COMPILE="C:/Program Files/Microchip/xc32/v4.35/bin/bin/pic32c-"
Enter the following text in the Clean command box:
make mplabclean CROSS_COMPILE="C:/Program Files/Microchip/xc32/v4.35/bin/bin/pic32c-"
Configure at91bootstrap to load harmony.bin from SD memory card.
Find the at91boostrap project directory. Select configs directory and then sama5d29_curiositysd_uboot_defconfig and click the Open button.
Make the following changes:
In this step, you are taking an existing default configuration and altering it to load the MPLAB Harmony v3 Software Framework application (harmony.bin) from the SD memory card. This makes configuration a little bit easier than starting from scratch.
Expand Next Software Type and select the Load 4 MB into start of SDRAM radio button.
Enter the address to load the application 0x26F00000 to The External Ram Address to Load Demo-App Image.
Build at91bootstrap
Build at91bootstrap.
Build the at91bootstrap project using one of the following methods:
- In the Projects pane, right-click on at91bootstrap and select Build from the menu, or
- Click on the Build icon (hammer) in the tool ribbon.
Observe the build is successful.
Note the location of boot.bin:
<project_directory>\at91bootstrap\build\binaries\boot.bin.
The boot.bin file is the binary image of at91bootstrap. The boot.bin image can be written to the SD memory card using the SAM-BA® Host Applet qspiflash. Instructions on how to do this are listed in the "Learn More" section.
Summary
The at91bootstrap has been configured and built to load an MPLAB Harmony v3 Software Framework application from the SD memory card on the SAMA5D29-Curiosity.