
AN2662
DFU bootloader
Doc ID 14156 Rev 1
The Host sends a DFU_DNLOAD request with the above parameters to remove the read
protection of the internal Flash memory.
The STM32F105xx and STM32F107xx receives the byte as follows:
After sending a Read Unprotect command, the Host has to send a DFU_GETSTATUS
request.
The Read Unprotect command is effectively executed only when a DFU_GETSTATUS
request is issued by the Host. If the status returned by the device is other than dfuDNBUSY,
then an error has occurred. After this operation, the device removes the Read Protection
and, consequently, both Internal Flash and Embedded RAM are fully erased.
Hence, just after executing this command, the device disconnects itself and executes a
System Reset. In this case, the device is not able to respond to a second Get Status
request. And the Host may wait till the Device is enumerated again.
A second DFU_GETSTATUS request may also be issued (if the device is still connected) to
check if the command has been correctly executed. If the device fails to execute the
command it will return an error status (depending on the error type).
Figure 60.
Read Unprotect Command: Device side
4.5.5 Leave
DFU
mode
It is possible to exit DFU mode (and bootloader) and jump to a loaded application (in the
internal Flash or in the embedded RAM) using the DFU download request.
The Host sends a DFU_DNLOAD request with 0 data length (no data stage after the
request) in order to inform the device that it will have to exit DFU mode. The device
acknowledges this request if the current state is dfuDNLOAD-IDLE or dfuIDLE.
Byte 1:
0x92
- Read Unprotect command
Read Unprotect
Command
System Reset
Remove Read Protection
Disconnect USB device
Erase the embedded
RAM
Operation done?
Yes
No
State = dfuERROR
Status = errUNKOWN