This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] SK-AM62: How to flash eMMC using USB DFU on AM62x-SK E2

Part Number: SK-AM62
Other Parts Discussed in Thread: CSD

This thread discusses the process of full Linux eMMC flashing using USB DFU on an AM62x-SK E2 board. A Linux host PC with the tool dfu-util is required.

  • The boot mode switches [SW2:SW1] of the AM62x board must be set to USB peripheral boot mode. See EVM Boot Mode Switches for correct positions for each boot mode.

    A type-C USB connector is required to connect from port J13 on the EVM to the Linux host. Also connect power and open a UART console with the EVM.

    Two sets of images must be built before flashing to eMMC, one set for USB-DFU boot, another set for flashing to eMMC (eMMC boot).

    First set of images to boot using USB-DFU:

    1.  These files may be built using the Build U-Boot instructions with “am62x_evm_r5_usbdfu_defconfig” and  “am62x_evm_a53_defconfig”.
    2. Additionally, on 8.6 SDK, the following patch must be applied in order to fix usb-dfu boot:
    3. If flashing the tisdk-default-image-am62xx-evm.tar.xz to eMMC using USB-DFU, the following patch might need to be applied in order to slow eMMC speed:

    The basic command for a DFU transfer on the Linux host is:

    • sudo dfu-util -R -a <name_on_target> -D <name_on_host>

    The following three commands must be used to transfer the U-Boot images from the host to the target:

    • sudo dfu-util -R -a bootloader -D tiboot3.bin
    • sudo dfu-util -R -a tispl.bin -D tispl.bin
    • sudo dfu-util -R -a u-boot.img -D u-boot.img

    After the transfer of the third file, stop the EVM from auto-booting by pressing any key in the EVM UART console. At this point, the u-boot starts executing on the target.

    At the U-Boot prompt, perform the following two commands. Alternatively, these two u-boot commands may also be built into u-boot.

    • setenv dfu_alt_info ${dfu_alt_info_emmc}
    • dfu 0 mmc 0

    Second set of images to flash to eMMC:

    1. Build tiboot3.bin, tispl.bin, and u-boot.img using the default u-boot build with “am62x_evm_r5_defconfig“ and “am62x_evm_a53_defconfig”.
    2. Additionally, the following patch might need to be applied to u-boot to fix eMMC boot from boot0 or boot1 partition:

    Apply this patch if you see the following issue after booting with eMMC boot:

    U-Boot SPL 2021.01-g2ee8efd654 (Feb 24 2023 - 05:59:23 +0000)
    SYSFW ABI: 3.1 (firmware rev 0x0008 '8.6.4--v08.06.04 (Chill Capybar')
    SPL initial stack usage: 13424 bytes
    Trying to boot from MMC1
    spl_register_fat_device: fat register err - -1
    spl_load_image_fat: error reading image tispl.bin, err - -1
    SPL: failed to boot from all boot devices
    ### ERROR ### Please RESET the board ###

    The above issue is know to occur in the following TI EVMs:
    - PROC114E2
    - PROC114A

    For full Linux flashing of the eMMC, use the following commands on the Linux host. The ext4 file can be any generic Linux file system including Linux kernel files and kernel DT files.

    • sudo dfu-util -a tiboot3.bin.raw -D <your_tiboot3.bin>
    • sudo dfu-util -a tispl.bin.raw -D <your_tispl.bin>
    • sudo dfu-util -a u-boot.img.raw -D <your_u-boot.img>
    • sudo dfu-util -a rootfs -D <your_rootfs.ext4>

    The following instructions can be used to prepare the <your_rootfs.ext4> using tisdk-base-image-am62xx-evm.tar.xz:
    $ cd <path-ti-psdk>/filesystem
    $ dd if=/dev/null of=tisdk-base.ext4 bs=1M seek=300
    $ mkfs.ext4 -F tisdk-base.ext4
    $ mkdir mnt_fs
    $ sudo mount -t ext4 tisdk-base.ext4 mnt_fs
    $ cd mnt_fs
    $ sudo tar xvf ../tisdk-base-image-am62xx-evm.tar.xz
    $ cd ..
    $ sudo umount mnt_fs

    Output on target console:
             ##DOWNLOAD ... OK
              Ctrl+C to exit ...
              ####DOWNLOAD ... OK
              Ctrl+C to exit ...
              ####DOWNLOAD ... OK
              Ctrl+C to exit ...

    To give the ROM access to the boot partition, the following commands must be used for the first time:
            => mmc partconf 0 1 1 1
            => mmc bootbus 0 2 0 0

    The above command sets up the EXT_CSD register of eMMC flash and enables boot from boot0 partition.

    Power the EVM off. Set the boot switches [SW2:SW1] to eMMC boot. When the board is powering on, hit any key to stop u-boot auto-booting. Enter the following u-boot commands. Alternatively, these u-boot commands may also be built into u-boot.

    To boot kernel from eMMC, use the following commands after writing rootfs to user partition:

    • setenv mmcdev 0
    • setenv bootpart 0
    • boot

    The board should now boot from eMMC with the updated files.