SAMA5D29-Curiosity – Configure and Build at91bootstrap for a MPLAB® Harmony v3 Project with MPLAB® X IDE

Last modified by Microchip on 2024/06/20 12:41

Introduction

This training topic describes how to configure and build at91bootstrap for loading and debugging an MPLAB® Harmony v3 project on the SAMA5D29-Curiosity Development Board (P/N: EV07R15A) using the MPLAB X Integrated Development Environment (IDE). 

at91bootstrap is a second-stage bootloader for Microchip Technology Arm®-based Microprocessor Unit (MPU). For more information, see the “at91bootstrap: A Second Stage Bootloader for Microchip MPUs” page. 

Background

The at91bootstrap is used by MPLAB X IDE to initialize Dynamic RAM (DRAM) so that it can continue loading the MPLAB Harmony v3 Software Framework project binary (harmony.bin). Once the project has been loaded onto the SAMA5D29-Curiosity, MPLAB X IDE can be used to develop and debug the application. 

Prerequisites

  • MPLAB X IDE Installed 
  • XC32 installed 

This training topic was developed with MPLAB X IDE v6.15 and XC32 v4.35 

Back to Top

Download at91bootstrap

Create a Project Directory.

For this training topic, we will 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.7 

Back to Top

Open Project at91bootstrap

From MPLAB X IDE, select File > Open Project…

An Open Project dialog is displayed.  


Find and select the at91bootstrap project directory

Click on the Open Project button.MPLAB X IDE - Open Project

The at91bootstrap project will be displayed in the Projects pane (upper left) and 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. 

Back to Top

Configure at91bootstrap Project Properties

Open at91bootstrap Project Properties 

Open the at91bootstrap Project Properties using one of the following methods:

  1. In the Projects pane, highlight at91bootstrap and click on the wrench icon in the at91bootstrap - Dashboard.
  2. In the Projects pane, right-click on at91bootstrap and select Properties from the menu.

The Projects Properties – at91bootstrap dialog box opens. 


In the Device dropdown box, select ATSAMA5D29 

Project Properties window


Highlight the latest DFP and click on the Apply button.

This will update the configuration to the latest DFP. 

If you received a Configuration Loading Error in the previous step, you may see a [Resolve] link next to the version of the DFP that was used to create the example application.


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.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-" 

Project Properties: makefile

Click on the Apply button.

Type the version number of the XC32 compiler on your host computer. In this step, we are using version 4.35.

The installation location of the XC compiler versions can be found by selecting from the MPLAB X IDE toolbar: 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. 


Configure at91bootstrap  

In the Categories pane, select Kconfig and click on the Load button.

Find the at91boostrap project directory and select configs directory. Then select sama5d29_curiositysd_uboot_defconfig and click on the Open button. 

Project Properties: kconfig: Load

 


Observe the following settings:

Expand Primary Operation and then click on the Configure and stop radio button. 

Project Properties: kconfig: Primary Operations

Expand DRAM. Next, expand DRAM parts and observe the LPDDR2 AS4C128M32MD2A (SAMA5D29-Curiosity) radio button is selected. 

Project Properties: kconfig: DRAM

Scroll down and expand Board’s Workaround Options. Expand Workaround for Board Quirks and observe the None Quirks for the board radio button is selected. 

Project Properties: kconfig: Board's Workaround Options

Click on the Apply and then the OK button. The Project Properties dialog will close.

This concludes configuring the at91bootstrap Project Properties.  

Back to Top

Build at91bootstrap

Build at91bootstrap 

Build the at91bootstrap project using one of the following methods: 

  1. In the Projects pane, right-click on at91bootstrap and select Build from the menu. 
  2. Click on the Build icon (hammer) in the tool ribbon. 

Observe the build is successful. 

MPLAB X IDE - build successful


Note the location of at91bootstrap.elf: 

<project_directory>/at91bootstrap/build/binaries/at91bootstrap.elf 

The at91bootstrap has been customized and compiled for debugging using the MPLAB X IDE for the SAMA5D29-Curiosity Development Board. 

Back to Top

Summary

The at91bootstrap has been configured and built to load and debug an MPLAB Harmony v3 Software Framework project using the MPLAB X IDE for the SAMA5D29-Curiosity Development Board. 

What’s Next?

Once the at91bootstrap has been configured and built, it can be used with an MPLAB Harmony v3 Software Framework project. When configuring an MPLAB Harmony v3 Software Framework project, at91bootstrap.elf file is configured in the Project Properties as shown in the accompanying example figure. 

MPLAB X IDE uses at91bootstrap to initialize DRAM and continue loading the MPLAB Harmony v3 Software Framework project binary (harmony.bin) using a Debug Probe. Once the project has been loaded onto the SAMA5D29-Curiosity, MPLAB X IDE can be used to develop and debug the application. 

Project Properties: Selecting bootloader file

Back to Top