
DFU bootloader
AN2662
Doc ID 14156 Rev 1
Figure 57.
Write Memory: Device side
4.5.2
Set Address Pointer command
The Set Address Pointer command is selected when wValue = 0 and the first byte of the
buffer sent by the Host is 0x21. The Buffer length should be 5 (the four remaining bytes are
the address bytes, LSB first (32-bit address format)).
The Host sends a DFU_DNLOAD request with the parameters above to set the Address
Pointer value used for computing the start address for Read and Write operations.
The STM32F105xx and STM32F107xx receives the bytes as follows:
After sending Set Address Pointer command, the host has to send DFU_GETSTATUS
request.
The Set AddressPointer 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.
Write Memory
No
Yes
Write the received buffer
to the destination address
Address allowed?
ROP active?
Yes
No
State = dfuERROR
Status = errVENDOR
Compute
address
State = dfuERROR
Status = errTARGET
State = dfuDNLOAD-IDLE
Status = OK
No
Yes
Destination == Option
Bytes?
System Reset
Byte 1:
0x21
- Set Address Pointer command
Byte 2:
A[7:0]
- LSB of the Address Pointer
Byte 3:
A[15:8]
- Second Byte of the Address Pointer
Byte 4:
A[22:16] - Third Byte of the Address Pointer
Byte 4:
A[31:23] - MSB of the address Pointer