Chapter 7
178
1XGTXKGY
To perform a firmware upgrade as described in the specification, a device must
have two complete sets of descriptors: run time and DFU mode. The run-time
descriptors are for normal operation and include descriptors that inform the
host that the device is capable of firmware upgrades. The DFU-mode descrip-
tors are for use when a device is upgrading its firmware. For example, a key-
board using its run-time descriptors enumerates as a HID-class device and
sends keypress data to the host. During a firmware upgrade, the device sus-
pends normal operations as a keyboard and uses the DFU-mode descriptors to
communicate with the DFU driver on the host.
The upgrade process has four phases. In the device-enumeration phase, the
device sends its run-time descriptors to the host and operates normally. In the
reconfiguration phase, the host sends a Dfu_Detach request and then resets and
re-enumerates the device, which returns its DFU-mode descriptors. In the
transfer phase, the host sends the firmware upgrade to the device. The manifes-
tation phase begins when the host has completed the transfer. When the device
has finished programming the new firmware, device settings determine whether
the host resets the device or the device initiates a reset by emulating detach and
re-attach. On re-enumerating, the device uses its new, upgraded firmware. Dur-
ing the upgrade process, the device transitions through defined states such as
dfuIdle (waiting for DFU requests) and dfuError (an error has occurred).
An upgrade file stored on the host contains the firmware for the upgrade fol-
lowed by a DFU suffix value that the host can use to help ensure that the firm-
ware is valid and appropriate for a particular device. The suffix contains an
error-checking value, a signature consisting of the ASCII text DFU, and
optional values for the Vendor ID, Product ID, and product release number to
identify devices the firmware is appropriate for. The suffix is for the host’s use
only; the host doesn’t send the suffix to the device.
To ensure that the host will load the correct driver for the firmware-upgrade
process, the device should use different Product IDs in its run-time and
DFU-mode device descriptors.
DFU communications use only the control endpoint.
&GUETKRVQTU
The DFU function is defined at the interface subclass level. In a device that
supports DFU, both the run-time and DFU-mode descriptors include a stan-
dard interface descriptor with bInterfaceClass = FEh to indicate an Application