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.

  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
menuconfig->SPL/TPL--->
   ..
   [*] Support booting from RAM
   [*] Support USB Gadget drivers
   [ ]    Support USB Ethernet drivers
   [*]    Support DFU (Device Firmware Upgrade)
             DFU device selection (RAM device) -->
Unselect CONFIG_HUSH_PARSER
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 J7200 EVM (SPL-DFU boot mode)

  • Set SYSBOOT switches to USB Peripheral boot mode (Refer to Initialization chapter of 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 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:6164] ver=0200, devnum=99, cfg=1, intf=0, path="3-3", alt=1, name="SocId", serial="01.00.00.00"
Found DFU: [0451:6164] ver=0200, devnum=99, cfg=1, intf=0, path="3-3", alt=0, name="bootloader", serial="01.00.00.00"

Send boot images in this order: tiboot3.bin -> 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:6164] ver=0224, devnum=100, cfg=1, intf=0, path="3-3", alt=1, name="u-boot.img", serial="UNKNOWN"
  Found DFU: [0451:6164] ver=0224, devnum=100, cfg=1, intf=0, path="3-3", 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.