SAM9X60 Curiosity Development Board - Configuring and Building at91bootstrap for an MPLAB® Harmony 3 Project Using MPLAB® X IDE

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

Configuring and Building AT91Bootstrap

This training topic describes configuring and building AT91Bootstrap using the MPLAB® X Integrated Development Environment (IDE) for loading and debugging on the SAM9X60 Curiosity Development Board an MPLAB Harmony 3 project.

Information

Note

AT91Bootstrap is a second-stage bootloader for Microchip Technology's, Arm®-based, microprocessors (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 DRAM so that it can continue loading the MPLAB Harmony 3 project binary (harmony.bin). Once the project has been loaded onto the SAM9X60 Curiosity Development Board, MPLAB X IDE can be used to develop and debug the application.

Prerequisites

  • MPLAB X IDE Installed
  • MPLAB XC32 installed
Information

This training was developed with MPLAB X IDE v6.00 and MPLAB XC32 v4.20

Download AT91Bootstrap

Create a Project Directory

For the purposes 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 into your project directory.

Back to top


Configure AT91Bootstrap Project Properties

Open AT91Bootstrap Project

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. 

Open Project dialog

The AT91Bootstrap project will be displayed in the Projects pane (upper left) and in the at91bootstrap – Dashboard pane (bottom left).


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.


Load Default Configuration

In the Categories pane, select Kconfig and click on the Load button.
Find the AT91Bootstrap project directory and select configs and then select sam9x60_curiosity_bkptnone_defconfig and click on the Open button.

Project Properties dialog


Make Changes to the Default Configuration

Expand Primary Operation and select the Configure and stop radio button.

Project Properties dialog - Configure and stop radio button

Expand DRAM. Next, expand the DRAM parts and select the DDR2 W971GG6SB (SAM9X60D1G SiP) radio button.

Project Properties dialog - DDR2 W971GG6SB (SAM9X60D1G SiP) radio button

Scroll down and expand Board’s Workaround Options. Expand Workaround for Board Quirks and select the Quirks for SAM9X60_CURIOSITY board radio button.

Project Properties dialog - Quirks for SAM9X60_CURIOSITY board radio button

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

Back to top


Configure Makefile Properties

In this section, you will configure the MPLAB XC32 compiler to compile the AT91Bootstrap.

Open AT91Bootstrap Project Properties

Open the AT91Bootstrap Projects Properties.


Configure the MPLAB XC32 Compiler

In the Categories pane, select Makefile.

Copy and paste the following text in the Build command and Debug build command boxes:

make CROSS_COMPILE="C:\Program Files\Microchip\xc32\v4.20\bin\bin\pic32c-"

Copy the following and paste into the Clean command box:

make mplabclean CROSS_COMPILE="C:\Program Files\Microchip\xc32\v4.20\bin\bin\pic32c-"
Information

Note

The installation location of the MPLAB XC32 Compiler versions can be found by selecting Tools > Options from the MPLAB X IDE toolbar. An Options dialog box will open. Select Embedded from the toolbar and then select the Build Tools tab.

Warning

Alert!

When cutting and pasting, beware of hidden formatting characters.

Project Properties dialog

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

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

Output window


Note the location of at91bootstrap.elf:

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

Back to top


Summary

The AT91Bootstrap has been configured and built to load and debug an MPLAB Harmony 3 project using the MPLAB X IDE for the SAM9X60 Curiosity Development Board.

Back to top

What's Next?

Once the AT91Bootstrap has been configured and built, it can be used with an MPLAB Harmony 3 project. The at91bootstrap.elf file is configured in the Project Properties as shown in the example figure:

Project Properties dialog

MPLAB X IDE uses AT91Bootstrap to initialize DRAM and continue loading the MPLAB Harmony 3 project binary (harmony.bin) using a Debug Probe. Once the project has been loaded onto the SAM9X60 Curiosity, MPLAB X IDE can be used to develop and debug the application. The "Migrating a MPLAB® Harmony 3 Software Framework Application from the SAM9X60-EK to SAM9X60-Curiosity: rtt_periodic_timeout" training provides step-by-step instructions.

Back to top