Save the Snapshot Image to an External NVM

Last modified by Microchip on 2026/08/17 10:39

Use SAM-BA® Software

SAM-BA® software provides an open set of tools for in-system programming of internal and external memories connected to Microchip MPUs. You can program your device through the JTAG, debug Universal Asynchronous Receiver/Transmitter (UART), or USB interfaces.

Download SAM-BA software with the following link:

Warning

Use SAM-BA software v3.9.x or later. You can download SAM-BA software v3.91 from the release page.

Install and Verify SAM-BA Software

Download the SAM-BA software package appropriate for your platform.


Extract the TGZ file in your workspace:

$ tar xvzf sam-ba_v3.9.1-linux_x86_64.tar.gz

Add the SAM-BA application to your $PATH.


Verify the installed version:

$ sam-ba -v
SAM-BA Command Line Interface Tool v3.9.1 (linux - x86_64-little_endian-lp64)
Copyright 2025 Microchip Technology
Information

This tool was tested with Ubuntu® 22.04 onward.

Ubuntu 20.04 and earlier versions are known to generate compatibility issues such as:

sam-ba: /lib64/libc.so.6: version 'GLIBC_2.34' not found (required by sam-ba)

Save Snapshot Image Using SAM-BA Software

Program the Snapshot Image to an SD™ Card

Determine the starting offset of the snapshot image on the SD card.

Display all partitions with:

$ fdisk -p /dev/sdb

Partitions


Identify the starting sector of the third partition.

For example, if the third partition starts at sector 1878016, calculate the offset as follows:

1878016 * 512 = 961544192

Program the snapshot image to the SD card:

$ sam-ba -p serial -b sam9x60-curiosity -a sdmmc -c write:snapshot.bin:961544192

Save Snapshot Image to NAND Flash

Erase the snapshot image region in NAND flash.

Verify the correct address using the FASTBOOT_IMG_ADDRESS configuration before erasing.

$ sam-ba -p serial -b sam9x60-curiosity -a nandflash -c erase:0x10000000

Write the snapshot image to NAND flash:

$ sam-ba -p serial -b sam9x60-curiosity -a nandflash -c write:binary.bin:0x10000000

Use Linux dd Command

The Linux dd command can also be used to write the snapshot image.

General syntax:

dd if=[input file] of=[output file] [options]

Program the Snapshot Image Using dd

Identify the target SD card partition. For example, /dev/sdb3 represents partition three of the SD card.


Write the snapshot image using dd with a block size of 1 MB:

$ sudo dd if=snapshot.bin of=/dev/sdb3 bs=1M status=progress conv=fdatasync

Back to Top