When our design uses MCUs from multiple vendors, DFU drivers may conflict. At this time, the unified use of open source DFU is a good choice.
The open source DFU tool ( dfu-util )can be used to unify the DFU programming problems of different MCU vendors.
dfu-util is a host side implementation of the DFU 1.0 and DFU 1.1 specifications of the USB forum. DFU is intended to download and upload firmware to/from devices connected over USB.
Development happens in a GIT repository. Browse it via the web interface or clone it with:
git clone git://git.code.sf.net/p/dfu-util/dfu-util
See the manual page for examples of use.
https://dfu-util.sourceforge.net/dfu-util.1.html
We can directly download the compiled software and use it.
dfu-util download | https://sourceforge.net/projects/dfu-util/
How do we use for APM32F407?
- Install the USB driver of DFU
The libusb that dfu-util uses by default does not perform well on windows computers, so we recommend installing winusb.
You can download from : https://zadig.akeo.ie/
and change APM32 ISP DFU to WinUSB.

- Check to see if the driver is working well
Short-circuit APM32F407 BOOT0 with VDD, and then plug in USB to put the chip into DFU mode.
Open dfu-util on the command line and use the following code to check the DFU device:
dfu-util.exe -l
If you see the following output, the USB driver is installed correctly

- Download the compiled bin file to APM32F407
Use the following code to download the bin file:
dfu-util.exe -a 0 -d 314b:0106 -s 0x08000000 -D .\GPIO_Toggle.bin
314B:0106 is USB PID VID.
0×08000000 is the address to be download by the software.
GPIO_Toggle.bin is the software you want to download.
If you see the output in the image below, congratulations! you download successfully.
Unplug the USB power supply and power it back on to see if the software starts running.
