
AN2662
DFU bootloader
Doc ID 14156 Rev 1
4 DFU
bootloader
4.1
Bootloader code sequence
Figure 52.
Bootloader for STM32F105xx and STM32F107xx with USB DFU
1.
After system reset, the device may return to the BL_DFU loop, enter the USART or CAN bootloader loops
or execute code from Flash/RAM depending on the connection states and the boot pins status.
2.
Leave DFU is achieved by a 0 Data Download request followed by GetStatus request and Device Reset.
3.
After six trials (the three clock configurations are tested twice), a System Reset is generated.
BL_DFU
Received
correct Packet?
No (Timeout)
Yes
Configure external oscillator
mode and re-initialize USB
Enumeration Phase
Enter DFU Mode
Wait for
Host commands
DFU Request
routines
DFU requests
Jump to
Leave DFU
routine
Leave DFU
Generate System
and exit DFU mode
Need reset ?
Reset
1)
Application Address
Yes
No
Mode
2)
Configure internal oscillator
mode and re-initialize USB
USB Device
connected
No
Yes
Device USB reset
Clock Detection
Phase
3)
Increment TrialNum
TrialNum > 6
Generate System
Reset