SAM-BA® In-System Programming and (ISP) - Boot MPLAB® Harmony Bare-Metal Application From NAND

Last modified by Microchip on 2026/10/08 11:03

Purpose

This tutorial shows how to program the required at91bootstrap and application binary images into NAND using SAM-BA® In-System Programming (ISPP) and verify that the application boots from NAND.

Overview

In this tutorial, you will

Prerequisites


Add the SAM-BA ISPP directory to your Path system environment variable.

System Path Update


Verify the installation. Open the Command Prompt and verify SAM-BA ISPP is accessible by running sam-ba –-version.

Windows PowerShell

Procedure

Part 1: Program the Bootloader and Application Binary Into NAND Using SAM-BA ISPP

Connect the USB cable J1 from your host PC needed for the SAM-BA ISPP (ROM boot programming interface).

Power the board using a USB Type-C cable from your host through J14.

USB setup


Connect the board to a serial terminal for console output at 115200 baud with the line ending set to "CR" through the FT4232H UART channel.

On the SAM9X75 Curiosity Hybrid Evaluation Board, Channel C of the FT4232H is connected to the UART.

Find the Channel C COM port number from Device Manager as follows:

Device manager

Now connect to the serial monitor as follows:

Serial Monitor


Open NAND boot jumper J9.

Press the Reset button and observe the RomBOOT message being printed on the console

Close the NAND boot jumper J9 to enable NAND Chip Select.


Program NAND using SAM-BA ISPP software.

You can download the script (nand_flash.bat), pre-built binaries harmony.bin and at91bootstrap.bin from the GitHub® repository.

Information

Run the nand_flash.bat script from the same folder where at91bootstrap.bin and harmony.bin are downloaded to flash NAND. It will flash the at91bootstrap and MPLAB Harmony v3 application binaries to NAND Flash memory.

Warning

Ensure you open jumper J9, press the reset button, close the NAND boot jumper, and execute SAM-BA ISPP CLI commands within 16 seconds to avoid boot interruption.

The nand_flash.bat script contains three commands:

  1. sam-ba -p serial -b sam9x75-curiosity -a nandflash -c erase::0x100000
  2. sam-ba -p serial -b sam9x75-curiosity -a nandflash -c writeboot:at91bootstrap.bin -c verifyboot:at91bootstrap.bin
  3. sam-ba -p serial -b sam9x75-curiosity -a nandflash -c write:harmony.bin:0x40000 -c verify:harmony.bin:0x40000​​​​​​

Instead of running the script, you can execute the commands sequentially from the command prompt as well.

Flash NAND using SAM-BA software


You can also monitor the serial console output while flashing NAND Flash memory using the SAM-BA ISPP software.

Console Output

This completes flashing NAND with the required boot and application binaries.

Part 2: Boot from NAND and Verify Output on the Serial Console

Press Reset on the board.


Confirm on the serial console that the ROM code loads from NAND and that at91bootstrap starts and launches the MPLAB Harmony application (expected console banner/output and application behavior, such as LED behavior).

The sample application and console messages are shown in the accompanying image:

Room Boot Message

SAM9X75 Curiosity Hybrid Evaluation Board

Back to Top

Results

You have successfully programmed both the bootloader and the MPLAB Harmony application into NAND using SAM‑BA ISPP and verified correct system startup by confirming the complete boot sequence from Boot ROM to at91bootstrap and finally to the MPLAB Harmony application, as observed through serial console output and expected application behavior.

Back to Top

Collaterals

Back to Top