Using USB-DFU Protocol

From Bitcoin Wiki
Jump to navigation Jump to search
DFU Device Descriptor
Offset Field Size Value Descripton
0 bLength 1 12h Size of this descriptor,in bytes.
1 bDescriptorType 1 01h DEVICE descriptor type.
2 bcdUSB 2 0100h USB specification release number in binary coded decimal.
4 bDeviceClass 1 00h See interface.
5 bDeviceSubClass 1 00h See interface
6 bDeviceProtocol 1 00h See interface.
7 bMaxPacketSize0 1 8,16,32,64 Maximum packet size for endpoint.
8 idVendor 2 ID Vendor ID. Assigned by the USB-IF.
10 idProduct 2 ID Product ID. Assigned by manufacturer.
12 bcdDevice 2 BCD Device release number in binary coded decimal.
14 iManufacturer 1 index index of string descriptor.
15 iProduct 1 index index of string descriptor.
16 iSerialNumber 1 index index of string descriptor.
17 bNumConfigurations 1 01h One configuration only for DFU.


DFU Interface Descriptor
Offset Field Size Value Descripton
0 bLength 1 09h Size of this descriptor,in bytes.
1 bDescriptorType 1 04h INTERFACE descriptor type.
2 bInterfaceNumber 1 Number Number of this interface.
3 bAlternateSetting 1 00h Alternate setting. Must be zero.
4 bNumEndpoints 1 00h Only the control pipe is used.
5 bInterfaceClass 1 FEh Application Specific Class Code.
6 bInterfaceSubClass 1 01h Device Firmware Upgrade Code.
7 bInterfaceProtocol 1 01h Runtime protocol.
8 iInterface 1 index Index of string descriptor for this interface.


DFU Functional Descriptor
Offset Field Size Value Descripton
0 bLength 1 09h Size of this descriptor,in bytes.
1 bDescriptorType 1 21h DFU FUNCTIONAL descriptor type.
2 bmAttributes 1 Bit mask DFU attributes

Bit 7……4: reserved

Bit 3: device will perform a bus detach-attach sequence when it receives a DFU_DETACH request. The host must not issue a USB Reset. (bitWillDetach)

0 = no

1 = yes

Bit 2: device is able to communicate via USB afeter Manifestation phase.(bitManifestationTolerant)

0 = no, must see bus reset

1 = yes

Bit1: upload capable(bitCanUpload)

0 = no

1 = yes

Bit0: download capable(bitCanDnload)

0 = no

1 = yes

3 wDetachTimeOut 2 Number Time,in milliseconds, that the device will wait after receipt of the DFU_DETACH request. if this time elapses without a USB reaset, then the device will terminate the Reconfiguration phase and revert back to normal operation . This repreents the maximum time that the device can wait(depending on its timers, etc.).The host may specify a shorter timeout in the DFU_DETACH request.
5 wTransferSize 2 Number Maximum number of bytes that the device can accept per control-write transaction.
7 bcdDFUVersion 2 BCD Numeric expression identifying the version of the DFU Specification release.


DFU Mode Interface Descriptor
Offset Field Size Value Descripton
0 bLength 1 09h Size of this descriptor,in bytes.
1 bDescriptorType 1 04h INTERFACE descriptor type.
2 bInterfaceNumber 1 Number Number of this interface.
3 bAlternateSetting 1 00h Alternate setting. Must be zero.
4 bNumEndpoints 1 00h Only the control pipe is used.
5 bInterfaceClass 1 FEh Application Specific Class Code.
6 bInterfaceSubClass 1 01h Device Firmware Upgrade Code.
7 bInterfaceProtocol 1 02h DFU mode protocol.
8 iInterface 1 index Index of string descriptor for this interface.