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. 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.

  1. Enable the SPL-DFU feature in u-boot and build MLO/u-boot binaries.
  2. Load the MLO and u-boot.img using the dfu-util from host PC.
  3. Once the u-boot is up, use DFU command from u-boot to flash the binary images from Host PC (using dfu-utils tool) to the eMMC, or QSPI to fresh/factory boards.
  • Example provided here is for dra7xx platform.
  • Use default “dra7xx_evm_defconfig” to build spl/u-boot-spl.bin, u-boot.img.
host$ make dra7xx_evm_defconfig
host$ make menuconfig

select SPL/DFU support
   [*] Support booting from RAM
   [*] Support USB Gadget drivers
   [ ]    Support USB Ethernet drivers
   [*]    Support DFU (Device Firmware Upgrade)
             DFU device selection (RAM device) -->
menuconfig--->Command Line interface
   [*] Support U-boot commands
   [ ]   Use hush shell
  • Build spl/u-boot-spl.bin and u-boot.img
host$ make

USB Peripheral boot mode on J721E EVM (SPL-DFU boot mode)

  • Set SYSBOOT switches to USB Peripheral boot mode (Refer to Initialization chapter of J721E TRM for boot switch details)
  • Make sure USB0 port in UFP/DRP mode: SW3[3:4] = 01 or 1x
  • Connect EVM’s TypeC port (USB0 port) to PC through USB cable
  • Power on the board

On host side:

host$ sudo dfu-util -l

This will show the following DFU entities:

Found DFU: [0451:6163] ver=0200, devnum=50, cfg=1, intf=0, path="3-2", alt=1, name="SocId", serial=""
Found DFU: [0451:6163] ver=0200, devnum=50, cfg=1, intf=0, path="3-2", alt=0, name="bootloader", serial=""

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

Move to directory containing the images and give the following commands

host$ sudo dfu-util -R -a bootloader -D tiboot3.bin
host$ sudo dfu-util -l
  Found DFU: [0451:6163] ver=0224, devnum=51, cfg=1, intf=0, path="3-2", alt=0, name="sysfw.itb", serial="UNKNOWN"

host$ sudo dfu-util -R -a sysfw.itb -D sysfw.itb
host$ sudo dfu-util -l
  Found DFU: [0451:6163] ver=0224, devnum=52, cfg=1, intf=0, path="3-2", alt=1, name="u-boot.img", serial="UNKNOWN"
  Found DFU: [0451:6163] ver=0224, devnum=52, cfg=1, intf=0, path="3-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

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


This mode is not supported on J721E Rev E2 and earlier boards.