SAMA7D65-Curiosity – Copy MPLAB® Harmony v3 Application and at91bootstrap to SD Memory Card

Last modified by Microchip on 2024/12/12 10:46

Introduction

In this training, you will copy harmony.bin (an MPLAB® Harmony v3 software framework application) and boot.bin (second-stage bootloader, at91bootstrap) generated with header, to an SD memory card for booting on the SAMA7D65-Curiosity Kit. Once the images are copied, the SD memory card is inserted, and upon reset, the SAMA7D65 will boot and run the application.

For this exercise, you will generate boot.bin with a header and write the binaries that were created in the training topics and from the sample project:

Prerequisites

The following are prerequisites to complete this training:

Information

​This training topic was developed with SAM-BA ISP v3.8.1.

Hardware

For this training, you will use the SAMA7D65-Curiosity Kit.

SAMA7D65-Curiosity Kit

Set up the SAMA7D65-Curiosity as listed below to the host computer:

​Be certain that the SAM-BA host application has been added to the path.

​Be sure to observe RomBOOT on the console. Otherwise, the SAM-BA host application cannot talk to the monitor on the target.

​For more information on SAM-BA host applets, see "SAM-BA ISP - Applets" page.

Back to Top

SD Memory Card

The SAMA7D65-Curiosity has a MultiMediaCard (MMC) or Secure Digital (SD) memory card slot (J10) for booting the system. The card is connected to the SDMMC port 1 (SDMMC1) peripheral of the SAMA7D65-Curiosity.

You will need an SD memory card formatted with the FAT file system for this training.

Ensure no other bootable Non-Volatile Memory (NVM) on the SAMA7D65-Curiosity contains a bootable image. Ensure there are no bootable images in NAND Flash (U8) or NOR Flash (U9). For information on the default boot sequence of the SAMA7D65-Curiosity, see Section 21, "Boot Strategies" in the SAMA7D6 datasheet.

Back to Top

Generate boot.bin with Header

Ensure at91bootstrap is built as shown on the "SAMA7D65-Curiosity – Configure and Build at91bootstrap to Load an MPLAB Harmony v3 Application from SD Memory Card" page.

In this section, you will generate at91bootstrap binary image boot.bin with header through the following commands:

Open command prompt and change directory to the location of boot.bin:

<project_directory>\at91bootstrap\build\binaries\boot.bin

Back to Top


Now generate a bootable sama7d65 bootstrap image file named boot_img.bin from a bootstrap binary file named boot.bin with SAM-BA.

$ sam-ba -u gen_image:sama7d65:boot.bin:::

Back to Top


Display the data stored in the header of a bootstrap image file, boot_img.bin.

$ sam-ba -u parse_image:boot_img.bin

Back to Top

Rename and Copy boot.bin to the SD Memory Card

In this section, you will rename and copy the at91bootstrap binary image as boot.bin, to an SD memory card with a FAT formatted partition.

Change directory to the location of boot_img.bin:

<project_directory>\at91bootstrap\build\binaries\boot_img.bin

Back to Top


Copy boot_img.bin to an SD memory card.

Back to Top


Rename boot_img.bin to boot.bin in the SD memory card.

Back to Top

Write harmony.bin to SD Memory Card

In this section, you will copy the MPLAB Harmony v3 software framework application binary image, harmony.bin, to the SD memory card into the same FAT formatted partition as you copied boot.bin into.

Change the directory to the location of harmony.bin:

C:\Users\<user>\HarmonyProjects\csp_apps_sama7d65\apps\pio\pio_led_on_off_interrupt\sam_a7d65_curiosity.X\dist\default\production

Back to Top


Copy harmony.bin to the SD memory card.

Back to Top

Run MPLAB Harmony v3 Application on the Target

Insert the SD memory card into the SD card slot (J4).

Back to Top


To run the application, press the RESET (SW4) push button. Observe that the RGB LED (D11) flashes blue. You can also observe the at91bootstrap reading from the SD memory card on the console.

Console: application running

Back to Top

Summary

In this training, you copied the binary files harmony.bin and boot.bin to an SD memory card for booting on the SAMA7D65-Curiosity and ran the application on the target.

Back to Top

Learn More

Back to Top