Skip to content
Manuel Bl edited this page Feb 25, 2024 · 5 revisions

Many STM32 microcontrollers have a bootloader supporting the USB DFU protocol. So firmware can be installed without the need for a debug adapter. Instead, inexpensive development boards like the Black Pill board are directly connected via USB to a computer.

BlackPill STM32 development board

Even though the DFU protocol is a standardized USB class, Windows does not provide a DFU driver for it. In fact, no driver is installed and the board is not accessible in DFU mode.

Step 1: Connect the board in DFU mode

For the bootloader to be accessible via USB, the board must be in DFU mode. To achieve it, hold down the BOOT button while connecting the board. Then verify in the Device Manager that the device has appeared as "STM32 BOOTLOADER". If not, try again. The board should also enter boot mode by holding down the BOOT button, then pressing the RESET button and finally releasing the BOOT button.

In the device manager, it will look like this. The board is connected in bootloader/DFU mode but is not usable (not the warning sign on the device icon):

Device Manager with warning sign

Step 2: Install the driver

DFU software can access the board if the WinUSB driver is installed. This is a standard driver of Windows (since about Windows 8). Unfortunately, it is not installed automatically.

In order to install it, a software called Zadig must be downloaded and installed.

When it is run, it will automatically detect USB devices without driver and directly propose to install the WinUSB driver.

Zadig before WinUSB installation

Click Install Driver to start the installation. It can take a minute.

After the installation, it should look like this:

Zadig after WinUSB installation

In the device manager, the warning sign should have disappeared as well:

Device Manager with working device