In this training topic, you will write two binary images, harmony.bin (an MPLAB® Harmony v3 Software Framework Application) and boot.bin (second-stage bootloader, at91bootstrap), to NAND Flash memory on the SAM9X75-Curiosity Development Board using the SAM-BA® In-System Programmer (ISP). Once the images are written and upon reset, the SAM9X75 will boot and run the application.
For this exercise, you will write the binaries that were created in the training topics:
The following are prerequisites to complete this training:
For this training, you will use the SAM9X75 Curiosity LAN Kit.
Set up the SAM9X75-Curiosity as listed below to the host computer running the SAM-BA host application.
Jumpers
SD Memory Cards
Power
Console Serial Communications
SAM-BA Host to Monitor Serial Communications
The SAM9X75-Curiosity has a 4 Gb NAND Flash memory (U5) (Macronix MX30LF4G28AD-XKI) that can be used for booting the system.
The at91bootstrap (boot.bin) binary will be written to location 0x0 to 0x0003FFFF. The MPLAB Harmony v3 Software Framework application (harmony.bin) binary will be written to location 0x00040000 to 0x000FFFFF.

In this section, you will establish SAM-BA host application communications with the target’s (SAM9X75) SAM-BA monitor. Then you will use the SAM-BA host applet (nandflash) to erase and then write the boot.bin (at91bootstrap) and harmony.bin (MPLAB Harmony v3 Software Framework application) binary images to NAND Flash memory.
To communicate with the SAM-BA monitor on the target, you must have installed the SAM-BA host on a host computer and connect a Micro-B USB cable to the USB Type-A port (J2) on the SAM9X75-Curiosity.
Ensure there is no SD memory card inserted in slot J14.
Open the QSPI BOOT Jumper (J10).
This will disable booting from the NOR (QSPI) Flash memory.
Close the NAND BOOT Jumper (J9).
This will allow booting from the NAND memory.
Press nRST (Reset) (SW3) push buttons.
The SAM9X75-Curiosity will boot to the SAM-BA monitor and start communications with the SAM-BA host application.
If you have Console Serial Communications established, you can observe ROMBoot on the Console (terminal emulator) indicating the SAM-BA monitor is running.
In this section, you will erase the contents of the NAND Flash Memory. This is a necessary step before writing data to NAND Flash memory.
Erase the contents of the NAND Flash memory using the following SAM-BA host applet command:



In this section, you will write the at91bootstrap binary image, boot.bin, to NAND Flash memory.
Change the directory to the location of boot.bin:
Write boot.bin to NAND Flash memory using the following SAM-BA applet command:


In this section, you will write the MPLAB Harmony v3 Software Framework application binary image, harmony.bin, to NAND Flash memory.
Change the directory to the location of harmony.bin:
Write harmony.bin to NAND Flash memory using the following sam-ba applet command:
The write command is write:<filename>:[<addr>] where <addr> is the Flash Offset for Demo App value in the at91bootstrap configuration (Kconfig). The value 0x40000 you took note of in the "SAM9X75-Curiosity – Configure and Build at91bootstrap to Load an MPLAB Harmony v3 Application from NAND Flash Memory" training page.



To run the application, press the nRST (Reset) (SW3) push button. Observe the RGB LED (LD1) flashes blue. You can also observe the at91bootstrap reading from the NAND Flash memory on the console.

In this training, you wrote the binary files harmony.bin and boot.bin to NAND Flash memory on the SAM9X75-Curiosity and ran the application on the target.