DFU (usb device upgrade)
DFU只使用control endpoint.




Reconfiguration Phase
该阶段用于应用需求进行升级,从正常模式切换到DFU模式。
Device检测到Host发送的DETACH命令,willdetach=1的设备会立即detach-attach。否则,device会开启timer,如果在wDetachTimeout时间内检测到一个usb reset则立即切换到DFU模式。


3.Transfer Phase
FW download和upload都有可能。
3.1 Downloading
N = ((F – S) / O) + 1
where
F is the size of the file, specified in bytes.
S is the size of the suffix, specified in bytes.
O is the transfer size, specified in bytes, [bMaxPacketSize0 , wTransferSize], 取决于host。
这个阶段,host持续的通过发送DFU_DNLOAD请求来发送固件数据片,然后通过DFU_GETSTATUS请求来确认device状态。只有在处于DFUIDLE状态时才允许继续发送下一个个数据片。
3.1.1

- The wBlockNum field is a block sequence number. It increments each time a block is transferred,wrapping to zero from 65,535. It is used to provide useful context to the DFU loader in the device.The wLength field indicates the total number of bytes in this transfer, according to USB version 1.0.This value should not exceed the value specified in the wTransferSize field.

3.1.2



2503

被折叠的 条评论
为什么被折叠?



