Dfu_abort request, Programming the flash – Rainbow Electronics AT89C5132 User Manual
Page 15

15
AT89C5132
4256A–USB–06/03
DFU_ABORT Request
The DFU_ABORT request enables the device to exit from certain states and return to
the DFU_IDLE state. The device sets the OK status on receipt of this request. For more
information, see the corresponding state transition summary.
Programming the Flash
The firmware image is downloaded via control-write transfers initiated by the
DFU_DNLOAD class-specific request. The host sends between bMaxPacketSize0 and
wTransferSize bytes to the device in a control-write transfer. Following each down-
loaded block, the host solicits the device status with the DFU_GETSTATUS request.
As described in the USB DFU Specification, Firmware images for specific devices are,
by definition, vendor specific. It is therefore required that target addresses, record sizes,
and all other information relative to supporting an upgrade are encapsulated within the
firmware image file. It is the responsibility of the device manufacturer and the firmware
developer to ensure that their devices can consume these encapsulated data. With the
exception of the DFU file suffix, the content of the firmware image file is irrelevant to the
host.
Firmware image:
•
32 bytes: Command
•
X bytes: X is the number of byte (00h) added before the first significative byte of the
firmware. The X number is calculated to align the beginning of the firmware with the
flash page. X = start_address [32]. For example, if the start address is 00AFh
(175d), X = 175 [32] = 15.
•
The firmware
•
The DFU Suffix on 16 Bytes
bmRequestType
bRequest
wValue
wIndex
wLength
Data
1010 0001b
DFU_ABORT (6)
Zero
Interface (4)
0
None
Table 12. DFU File Suffix
Offset
Field
Size
Value
Description
- 0
dwCRC
4
Number
The CRC of the entire file, excluding dwCRC
- 4
bLength
1
16
The length of this DFU suffix including dwCRC
- 5
ucDfuSignature
3
5 : 44h
6 : 46h
7 : 55h
The unique DFU signature field
- 8
bcdDFU
2
BCD
0100h
DFU specification number
- 10
idVendor
2
ID
The vendor ID associated with this file. Either FFFFh or must match
device’s vendor ID
- 12
idProduct
2
ID
The product ID associated with this file. Either FFFFf or must match
device’s product ID
- 14
bcdDevice
2
BCD
The release number of the device associated with this file. Either
FFFFh or a BCD firmware release or version number