1.3. Flashing Instruction

1.3.1. DFU Recovery

It’s possible to put the AM62Px SK EVM in USB DFU mode, which allows loading bootloaders over DFU. This is done via the snagboot tool.

This is useful for initial flashing or recovering boards which have broken bootloaders.

1.3.1.1. Installation and setup

Install snagboot following the official instructions

Note

Snagboot requires at least Python 3.8, meaning that it can’t run on Ubuntu 18.04 releases. If Snagboot cannot be installed, it’s possible boot the initial bootloaders from an SD card.

Follow AM62Px Initial Flashing on SD card if you encounter issues with Snagboot.

1.3.2. eMMC flashing

1.3.2.1. Flashing instructions

Once the build is complete, follow the steps below to flash the images to eMMC.

../_images/am62x_sk_evm_setup.jpg
  1. Change the boot mode DIP switches to DFU mode:

    Boot mode DIP Switch:
    SW1: 11001010 SW2: 00000000
    
  2. Ensure the device is plugged in with USB host and debug UART/serial debug

  3. Open a terminal debugger to view console output from the device:

    sudo picocom -b 115200 -r -l /dev/ttyUSB0
    
  4. run snagrecover for host

# If you are using binaries built locally
cd out/target/product/am62p

(OR)

# If you are using pre-built binaries from SDK download page
cd AM62Px_09.01.00_emmc

snagrecover -s am625 -f ./am62px-sk-evm-hsfs.yaml

In the serial console, you will see:

SYSFW ABI: 3.1 (firmware rev 0x0009 '9.0.5--v09.00.05 (Kool Koala)')
SPL initial stack usage: 1856 bytes
Trying to boot from DFU
  1. Setup default U-Boot environment

Type Ctrl-C in the serial console to continue to U-Boot. From there, we should ensure the default U-Boot environment is configured with:

=>  env default -f -a; saveenv;

Note

If you build with TARGET_AVB_ENABLE=true or flash user images you need to do this command in U-Boot console:

=> setenv force_avb "1"; saveenv;

Note

By default, no Device-Tree Overlays are selected. Follow this link to set AM62Px Device Tree Overlays

  1. Enable fastboot mode on the device through the terminal debugger by executing below command. Before running this command make sure USB-C cable is connected from the host PC to the EVM:

    => fastboot 0
    
  2. From the host PC run the flashall.sh script to start flashing the binaries to eMMC:

# If you are using binaries built locally
cd out/target/product/am62p

(OR)

# If you are using pre-built binaries from SDK download page
cd AM62Px_09.01.00_emmc

sudo ./flashall.sh --board am62px-sk

Note

If you get mcopy command not found error on Linux PC, install the mtools package:

$ apt-get install mtools

Warning

It’s possible that the in-memory partition layout is still from an older system. In that case, we can observe flashing errors similar to:

writing 'tiboot3'...
FAILED (remote: invalid partition or device)

When that happens:

  1. Reboot into the newfly flashed bootloader with $ fastboot reboot bootloader
  2. Restart the flashing from step 5.
  1. Once the flashing is complete, power off the board

  2. Change boot mode DIP switches to boot from eMMC user partitions and power cycle the board:

    Boot mode DIP Switch:
    SW1: 11000010 SW2: 00000000
    
  3. Board should boot the Android images now.

1.3.3. Flashing the kernel

In order to flash a new kernel, the new boot image should be flashed:

adb reboot bootloader
< Wait for bootloader reboot >

cd <PATH/TO/BOOT/IMAGE>
fastboot flash boot boot.img
fastboot reboot

The board should boot with the new kernel build.