
AN2662
DFU bootloader
Doc ID 14156 Rev 1
Figure 55.
Download request: Device side
1. This routine can be used to reset the device to be reset or to jump to the application.
Download request
Erase
command
Set Address
No
Yes
Decode the command
(First byte of the received buffer)
Set Address
Pointer routine
Read Unprotect
wBlockNum == 0 ?
Pointer command
Unsupported
command
Erase
routine
State = dfuERROR
Status = errSTALLEDPKT
Read Unprotect
routine
command
Write Memory
routine
No
Yes
wBlockNum > 1?
Stall
Wait for data stage
Return Status:
dfuDNBUSY
Current status is
dfuIDLE or dfuDNLOAD-IDLE
Stall
No
Acknowledge
the request
Yes
Receive data
buffer
Wait for Get Status
wLength > 0
Yes
No
routine
1)
Leave DFU