Snagboot Command Instructions¶
Snagboot is an open-source and generic replacement to the vendor-specific, sometimes proprietary, tools used to recover and/or reflash embedded platforms. It combines the dfu and fastboot protocols.
Note: DFU alone can be used to boot and flash the SOM by itself. However due to the current u-boot implementation the throughput is only ~2.6MB/s. By switching to the fastboot protocol after reaching u-boot, we can flash at ~25.8MB/s saving significant flashing time. Fastboot also supports the android sparse image format so if the image file is created properly, it can skip sending large chunks of zeros or ones saving more time.
The following instructions are compatible for the MitySOM-AM62x, MitySOM-AM62A, and MitySOM-AM62P.
References¶
Installing Snagboot¶
- Make snagboot project directory
$ mkdir <WORK_DIR>/snagboot
$ cd <WORK_DIR>/snagboot
- Create a python virtual environment
$ python3 -m venv myenv
$ source myenv/bin/activate
- Clone the github repository (for this example version v2.2)
$ git clone https://github.com/bootlin/snagboot.git
$ cd snagboot
$ ./install.sh
$ cd ..
- Check that snagboot has been installed and you have access to snagboot commands
$ snagrecover -h
$ snagflash -h
Build a Snagboot Compatible U-boot¶
Setup the device¶
- Connect the device and host computer with a USB cable.
- Set the boot switches to DFU/Snagboot mode. Switches: SW1 = [00001010] SW2 = [01000000].

- Turn on the device.
Boot to U-boot Using Snagrecover¶
The snagrecovery step handles loading the bootloader into RAM to prep for flashing the emmc in the next stage.
- Download firmware binaries .yaml file to your snagboot directory: am62xx-beagle-play.yaml
- Copy the necessary binaries to your snagboot directory
$ cp <U-BOOT_DIR>/u-boot-ti/build-mitysom_am62px_devkit/a53/u-boot.img <U-BOOT_DIR>/u-boot-ti/build-mitysom_am62px_devkit/a53/tispl.bin <U-BOOT_DIR>/u-boot-ti/build-mitysom_am62px_devkit/r5/tiboot3.bin <SNAGBOOT_DIR>
- Run snagrecover command and boot to u-boot prompt
$ snagrecover -s <am62x/a/p> -f am62xx-beagle-play.yaml
- Your Serial Port terminal should have the following output:
Terminal OutputTerminal Output
U-Boot SPL 2024.04-g96357debfc-dirty (Feb 21 2025 - 13:30:41 -0500)
SYSFW ABI: 4.0 (firmware rev 0x000a '10.1.8--v10.01.08 (Fiery Fox)')
Configuring LPDDR4 for 2GB
SPL initial stack usage: 17048 bytes
Trying to boot from DFU
############################################################DOWNLOAD ... OK
Ctrl+C to exit ...
U-Boot SPL 2024.04-g96357debfc-dirty (Feb 21 2025 - 13:30:41 -0500)
SYSFW ABI: 4.0 (firmware rev 0x000a '10.1.8--v10.01.08 (Fiery Fox)')
Configuring LPDDR4 for 2GB
SPL initial stack usage: 17048 bytes
Trying to boot from DFU
############################################################DOWNLOAD ... OK
Ctrl+C to exit ...
###########################################################DOWNLOAD ... OK
Ctrl+C to exit ...
Authentication passed
Authentication passed
Authentication passed
init_env from device 10 not supported!
Authentication passed
Authentication passed
Starting ATF on ARM64 core...
NOTICE: BL31: v2.11.0(release):v2.11.0-906-g58b25570c
NOTICE: BL31: Built : 10:57:59, Jan 28 2025
I/TC:
I/TC: OP-TEE version: 4.4.0 (gcc version 13.3.1 20240614 (Arm GNU Toolchain 13.3.Rel1 (Build arm-13.24))) #1 Tue Jan 28 15:57:56 UTC 2025 aarch64
I/TC: WARNING: This OP-TEE configuration might be insecure!
I/TC: WARNING: Please check https://optee.readthedocs.io/en/latest/architecture/porting_guidelines.html
I/TC: Primary CPU initializing
I/TC: GIC redistributor base address not provided
I/TC: Assuming default GIC group status and modifier
I/TC: SYSFW ABI: 4.0 (firmware rev 0x000a '10.1.8--v10.01.08 (Fiery Fox)')
I/TC: HUK Initialized
I/TC: Primary CPU switching to normal world boot
U-Boot SPL 2024.04-g96357debfc-dirty (Feb 21 2025 - 13:31:08 -0500)
SYSFW ABI: 4.0 (firmware rev 0x000a '10.1.8--v10.01.08 (Fiery Fox)')
SPL initial stack usage: 1776 bytes
Trying to boot from DFU
#####DOWNLOAD ... OK
Ctrl+C to exit ...
Authentication passed
Authentication passed
U-Boot 2024.04-g96357debfc-dirty (Feb 21 2025 - 13:31:08 -0500)
SoC: AM62PX SR1.0 HS-FS
Model: Critical Link MitySOM-AM62px
MitySOM-62x - Model No: 62P54-TX-XAD-RI-X Serial No: 24019816 Part Number: 80-001753RI-1A
DRAM: 2 GiB
Core: 102 devices, 29 uclasses, devicetree: separate
MMC: mmc@fa10000: 0, mmc@fa00000: 1
Loading Environment from FAT... Unable to read "uboot.env" from mmc1:1...
Loading Environment from MMC... *** Warning - bad CRC, using default environment
In: serial@2800000
Out: serial@2800000
Err: serial@2800000
Net: eth0: ethernet@8000000port@1, eth1: ethernet@8000000port@2
Hit any key to stop autoboot: 0
generic_phy_get_bulk : no phys property
Flash a Sparse File Using Snagflash¶
- Find your device id.
$ lsusb
...
Bus 003 Device 041: ID 0451:6165 Texas Instruments, Inc. USB download gadget
...
- Download the ext3 file you wish to flash and convert it to a sparse file
$ img2simg <file.ext3> <file.ext3>.sparse
- Run snagflash command and flash the spare file
$ snagflash -P fastboot -p 0451:6165 -f oem-format
$ snagflash -P fastboot -p 0451:6165 -f flash_sparse:<file.ext3.sparse>:rootfs
- Your Serial Port terminal should have the following output:
Terminal OutputTerminal Output
dwc3-generic-peripheral usb@31000000: request 00000000fded7100 was not queued to ep1in-bulk
Starting download of 117436792 bytes
dwc3-generic-peripheral usb@31000000: request 00000000fded7100 was not queued to ep1in-bulk
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
.......
downloading of 117436792 bytes finished
dwc3-generic-peripheral usb@31000000: request 00000000fded7100 was not queued to ep1in-bulk
Flashing sparse image at offset 2048
Flashing Sparse Image
........ wrote 147570688 bytes to '.'
dwc3-generic-peripheral usb@31000000: request 00000000fded7100 was not queued to ep1in-bulk
Starting download of 117436508 bytes
dwc3-generic-peripheral usb@31000000: request 00000000fded7100 was not queued to ep1in-bulk
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
.......
downloading of 117436508 bytes finished
dwc3-generic-peripheral usb@31000000: request 00000000fded7100 was not queued to ep1in-bulk
Flashing sparse image at offset 2048
Flashing Sparse Image
........ wrote 117456896 bytes to '.'
dwc3-generic-peripheral usb@31000000: request 00000000fded7100 was not queued to ep1in-bulk
Starting download of 117436580 bytes
dwc3-generic-peripheral usb@31000000: request 00000000fded7100 was not queued to ep1in-bulk
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
.......
downloading of 117436580 bytes finished
dwc3-generic-peripheral usb@31000000: request 00000000fded7100 was not queued to ep1in-bulk
Flashing sparse image at offset 2048
Flashing Sparse Image
........ wrote 125607936 bytes to '.'
dwc3-generic-peripheral usb@31000000: request 00000000fded7100 was not queued to ep1in-bulk
Starting download of 116724016 bytes
dwc3-generic-peripheral usb@31000000: request 00000000fded7100 was not queued to ep1in-bulk
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..........................................................................
..
downloading of 116724016 bytes finished
dwc3-generic-peripheral usb@31000000: request 00000000fded7100 was not queued to ep1in-bulk
Flashing sparse image at offset 2048
Flashing Sparse Image
........ wrote 261746688 bytes to '.'
dwc3-generic-peripheral usb@31000000: request 00000000fded7100 was not queued to ep1in-bulk
TODO:¶
figure out how to run the following fastboot commands using snagflash and boot to the kernel
fastboot flash tiboot3 tiboot3.bin
fastboot flash tispl tispl.bin
fastboot flash uboot u-boot.img
Summary¶
This wiki page has demonstrated the following:
- Installing Snagboot from the github repository
- Boot the devkit in DFU/Snagboot mode and create a snagboot compatible u-boot
- Run snagboot to boot to u-boot prompt and snagflash to flash a sparse file onto the board