DFU bootloader AN2662
78/83 Doc ID 14156 Rev 1
The STM32F105xx and STM32F107xx receives the bytes as follows (Mass Erase):
After sending an Erase command, the host has to send a DFU_GETSTATUS request.
The Erase 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.
A second DFU_GETSTATUS request is needed to check if the command has been correctly
executed. If the received page address is wrong or unsupported, the device status will then
be (Status = dfuERROR, State = errTARGET). If the Flash Read Protection is active, then
the device returns the status (Status = dfuERROR, State = errVENDOR) and the erase
operation is ignored by the device.
The allowed values for Erase page address are:
● Internal Flash memory addresses.
Note: No error is returned when performing erase operations on write protected sectors.
Figure 59. Erase Command: Device side
4.5.4 Read Unprotect command
The Read Unprotect command is selected when wValue = 0 and the first byte of the buffer
sent by the Host is 0x92. The Buffer length should be only 1 byte (only the command byte).
Byte 1: 0x41 - Erase command
Erase
Command
Mass Erase
No
Ye s
Data Length = 1?
Flash
No
Ye s
Erase the related Flash
Page
Address allowed?
ROP Active ?
Ye s
No
State = dfuERROR
Status = errVENDOR
Compute
address
State = dfuERROR
Status = errTARGET
State = dfuDNLOAD-IDLE
Status = OK