This training topic describes how to download, configure, and build at91bootstrap to load a MPLAB® Harmony 3 Software Framework application binary image (harmony.bin) from SD memory card to DDR2 SDRAM on the SAM9X60-EK Evaluation Kit 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.
at91bootstrap is a second-stage bootloader for Microchip Technology Arm®-based microprocessors (MPU). For more information see at91bootstrap: *A Second Stage Bootloader for Microchip MPUs
- SAM9X60-EK - Booting from QSPI Flash Memory
- MPLAB X IDE Installed on the host computer
- MPLAB XC32 Compiler Installed on the host computer
This training topic was developed with MPLAB X IDE v6.05 and XC32 v4.21
Create a Project Directory
For the purpose of this training topic, we’ll name our project directory at91bootstrap.
Download or clone at91bootstrap version 4
Download or clone from the Linux4sam GitHub repository.
This training topic was developed with at91bootstrap version 4.0.5
Open Project at91bootstrap
From MPLAB X IDE, select File > Open Project… to display an Open Project dialog box.
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).
You may receive a Configuration Loading Error. This is due to an older version of the Device Family Pack (DFP) at the time of creating the at91bootstrap project. You will update the DFP to the latest version in the next steps.
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.
If you received a Configuration Loading Error in the previous step, you may see a [Resolve] link next to a version of the Device Family Pack (DFP). Highlight the latest DFP and click on the Apply button. This will update the configuration to the latest DFP.
DFP: The Device Family Pack (DFP) contains device-specific support software. The 32-bit MCU and MPU DFPs are maintained by Microchip Technology and are available on GitHub.
Configure the 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.21/bin/bin/pic32c-"
Enter the following text in the Clean command box:
make mplabclean CROSS_COMPILE="C:/Program Files/Microchip/xc32/v4.21/bin/bin/pic32c-"
Type the version number of the XC32 compiler on your host computer. In this step we are using version 4.21.
The installation location of the XC compiler versions can be found by selecting from the MPLAB X IDE tool bar: Tools > Options. An Options dialog box will open. Select Embedded from the toolbar and select the Build Tools tab.
When cutting and pasting, beware of hidden formatting characters.
Click on the Apply button.
Make the following changes:
In this step you are taking an existing default configuration and altering it to load the MPLAB Harmony 3 Software Framework application (harmony.bin) from SD memory card. This makes configuration a little bit easier than starting from scratch.
Expand Demo Application Image Storage Setup
Enter harmony.bin to Next Software Image File Name
Click on the Apply and OK buttons.
This completes the configuration of the at91bootstrap project properties.
Build the at91bootstrap project using one of the following methods:
- In the Projects pane, right-click on at91bootstrap and select Build from the menu.
- Click on the Build icon (hammer) in the tool ribbon.
Note the location of boot.bin:
The boot.bin file is the binary image of at91bootstrap. The boot.bin image can now be copied to an SD memory card with a FAT formatted partition. Instructions on how to do this are listed in the "What’s Next?" section below.
The at91bootstrap has been configured and built to load an MPLAB Harmony 3 Software Framework application from SD memory card on the SAM9X60-EK.