SAMA7D65-Curiosity – Copy MPLAB® Harmony v3 Application and at91bootstrap to SD Memory Card
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:
- SAMA7D65-Curiosity – Getting Started with MPLAB® Harmony v3 Development: CSP Application: pio_led_on_off_interrupt
- SAMA7D65-Curiosity – Configure and Build at91bootstrap to Load a MPLAB® Harmony v3 Application from SD Memory Card
Prerequisites
The following are prerequisites to complete this training:
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:
- Jumpers
- Set the jumpers to their default positions as shown in the "Jumper Summary" section in the "SAMA7D65-Curiosity — Features" page.
- Power
- Apply power as shown in "Power Options" section in the "SAMA7D65-Curiosity — Features" page.
- Console Serial Communications
- To view the target console, connect the host computer running a terminal emulation program following SAMA7D65-Curiosity – Console Serial Communications.
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.
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
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:::
Display the data stored in the header of a bootstrap image file, boot_img.bin.
$ sam-ba -u parse_image:boot_img.bin
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
Copy boot_img.bin to an SD memory card.
Rename boot_img.bin to boot.bin in the SD memory card.
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
Copy harmony.bin to the SD memory card.
Run MPLAB Harmony v3 Application on the Target
Insert the SD memory card into the SD card slot (J4).
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.
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.
Learn More
- SAMA7D65-Curiosity – Configure and Build at91bootstrap to Load an MPLAB Harmony v3 Application from NAND Flash Memory
- SAMA7D65-Curiosity – Configure and Build at91bootstrap to Load an MPLAB Harmony v3 Application from NOR Flash (QSPI) Memory
- SAMA7D65-Curiosity – Writing MPLAB Harmony v3 Application and at91bootstrap to NAND Memory Using SAM-BA ISP
- SAMA7D65-Curiosity – Writing MPLAB Harmony v3 Application and at91bootstrap to NOR Flash (QSPI) Memory Using SAM-BA ISP