3.1.1.2. USB Device Firmware Upgrade (DFU)

When working with USB Device Firmware Upgrade (DFU), regardless of the medium to be written to and of the board being used, there are some general things to keep in mind. First of all, you will need to get a copy of the dfu-util program installed on your host. If your distribution does not provide this package you will need to build it from source. Second, the examples that follow assume a single board is plugged into the host PC. If you have more than one device plugged in you will need to use the options that dfu-util provides for specifying a single device to work with. Finally, to program via DFU for a given storage device see the section for the storage device you are working with.

3.1.1.2.1. USB Peripheral boot mode (SPL-DFU support)

The USB Peripheral boot mode is used to boot using USB interface using SPL-DFU feature. Steps outlined here can be used on platform that support USB Peripheral boot mode.

Note

Please refer to workarounds to fix the USB Device Firmware Upgrade (DFU) Boot failure in AM62x.

  1. Build tiboot3.bin using am62x_evm_r5_defconfig along with am62x_r5_usbdfu.config fragment. Build tispl.bin and u-boot.img using am62x_evm_a53_defconfig. For instructions to build the bootloader images please refer to Build U-Boot.

  2. Load the bootloader images tiboot3.bin, tispl.bin and u-boot.img using the dfu-util tool on the Host PC.

  3. Once U-Boot is up, use the DFU command at U-Boot prompt to flash the binary images from the Host PC (using dfu-utils tool) to the eMMC, or QSPI to fresh/factory boards.

USB Peripheral boot mode on AM62x SK (SPL-DFU boot mode)

  • Set SYSBOOT switches to USB DFU boot mode (Refer to Initialization chapter of AM62 TRM for boot switch details)

  • Connect USB Type C DRD Port (J13) on SK board to PC through USB cable

  • Power on the board

On Linux host

host$ sudo dfu-util -l

On Windows host

Download dfu-util from Releases section of dfu-util Homepage and extract the zip file.

host> dfu-util.exe -l

This will show the following DFU entities:

Found DFU: [0451:6165] ver=0200, devnum=9, cfg=1, intf=0, path="1-2.2", alt=1, name="SocId", serial="01.00.00.00"
Found DFU: [0451:6165] ver=0200, devnum=9, cfg=1, intf=0, path="1-2.2", alt=0, name="bootloader", serial="01.00.00.00"

Send boot images in this order: tiboot3.bin -> tispl.bin -> u-boot.img

Note

On Windows, if you face any issues while listing the available DFU Interfaces, try installing/updating the Generic USB DFU Drivers using Zadig.

Move to directory containing the images and give the following commands

On Linux host

host$ sudo dfu-util -R -a bootloader -D tiboot3.bin
host$ sudo dfu-util -l
  Found DFU: [0451:6165] ver=0224, devnum=11, cfg=1, intf=0, path="1-2.2", alt=1, name="u-boot.img", serial="UNKNOWN"
  Found DFU: [0451:6165] ver=0224, devnum=11, cfg=1, intf=0, path="1-2.2", alt=0, name="tispl.bin", serial="UNKNOWN"

host$ sudo dfu-util -R -a tispl.bin -D tispl.bin
host$ sudo dfu-util -R -a u-boot.img -D u-boot.img

On Windows host

host> dfu-util.exe -R -a 0 -D tiboot3.bin
host> dfu-util.exe -l
  Found DFU: [0451:6165] devnum=0, cfg=1, intf=0, alt=0, name="tispl.bin"
  Found DFU: [0451:6165] devnum=0, cfg=1, intf=0, alt=1, name="u-boot.img"

host> dfu-util.exe -R -a 0 -D tispl.bin
host> dfu-util.exe -R -a 1 -D u-boot.img

Note

On Windows host, if name of the DFU Interface doesn’t work, use alt number instead.

At this point, the board should boot to the U-Boot prompt.