1.3. Flashing Instruction

These instructions are for the AM62x SK EVM.

For flashing the Beagle Play, see the dedicated application note.

1.3.1. DFU Recovery

It’s possible to put the AM62x 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

If Snagboot cannot be installed, it’s possible boot the initial bootloaders from an SD card.

Follow Android Bootloader 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:

    Switch Label

    SW2: 12345678

    SW3: 12345678

    USB DFU

    00000000

    11001010

  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/am62x

(OR)

# If you are using pre-built binaries from SDK download page
$ cd AM62x_09.02.00_emmc

# for AM62x SK EVM (GP)
$ snagrecover -s am625 -f ./am62x-sk-evm.yaml

# for AM62x SK EVM (HS-FS)
$ snagrecover -s am625 -f ./am62x-sk-evm-hsfs.yaml

# for AM62x LP SK EVM (GP)
$ snagrecover -s am625 -f ./am62x-lp-sk-evm.yaml

# for AM62x LP SK EVM (HS-FS)
$ snagrecover -s am625 -f ./am62x-lp-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 configure Device Tree Overlay Support

  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/am62x

(OR)

# If you are using pre-built binaries from SDK download page
$ cd AM62x_09.02.00_emmc

# for AM62x SK EVM (GP)
$ sudo ./flashall.sh --board am62x-sk

# for AM62x SK EVM (HS-FS)
$ sudo ./flashall.sh --board am62x-sk --hsfs

# for AM62x LP SK EVM (GP)
$ sudo ./flashall.sh --board am62x-lp-sk

# for AM62x LP SK EVM (HS-FS)
$ sudo ./flashall.sh --board am62x-lp-sk --hsfs

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:

    Switch Label

    SW2: 12345678

    SW3: 12345678

    EMMC (with UDA)

    00000000

    11000010

  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.