stm dfu_如何在Windows上修复dfu-util,STM,WinUSB,Zadig,Bootloader和其他固件刷新问题

stm dfu

stm dfu

Flashing devices wtih dfu-util

I'm pretty happy with Windows 10 as my primary development box. It can do most anything I want, run a half-dozen Linuxes, and has a shiny new open source Terminal, and has great support for Docker now.

我对Windows 10作为主要的开发工具感到非常满意。 它可以执行我想执行的大多数操作,可以运行六个Linux ,并具有闪亮的新开源终端,并且现在对Docker具有强大的支持



For years - YEARS I SAY - Windows has been a huge hassle when you want to flash the firmware of various devices over USB.


The term "dfu" means Device Firmware Update and dfu-util is the Device Firmware Update Utility, natch.

术语“ dfu”表示设备固件更新,dfu-util是设备固件更新实用程序natch。

Very often I'll find myself with a device like a Particle Photon, Wilderness Labs Meadow, or some STM32 device that uses the ST Bootloader.

很多时候,我会发现自己使用诸如粒子光子,Wilderness Labs Meadow或使用ST Bootloader的STM32设备之类的设备。

The Mac and Linux instructions usually say something like "plug it in and party on" but folks like myself with Windows have to set up a WinUSB Driver (libusb-win32 or libusbK) as dfu-util uses those libraries to speak to USB devices.


If you plug in a device, the vast majority of Windows users want the device to 'just work.' My non-technical parent doesn't want Generic USB drivers so they can flash the firmware on their mouse. I, however, as an aristocrat, sometimes want to do low-level stuff and flash an OS on a Microcontroller.

如果您插入设备,则绝大多数Windows用户都希望该设备“正常运行”。 我的非技术父母不想要通用USB驱动程序,因此他们可以在鼠标上刷新固件。 但是,作为贵族,我有时想做底层工作,并在微控制器上刷新操作系统。

Today, the easiest way to swap the "inbox" driver with WinUSB is using a utility called Zadig. Per their docs:

如今,用WinUSB交换“收件箱”驱动程序的最简单方法是使用名为Zadig的实用程序。 根据他们的文档:

Zadig is a Windows application that installs generic USB drivers, such as WinUSB, libusb-win32/libusb0.sys or libusbK, to help you access USB devices.

Zadig是Windows应用程序,它安装了通用USB驱动程序,例如WinUSBlibusb-win32 / libusb0.syslibusbK ,以帮助您访问USB设备。

It can be especially useful for cases where:


  • you want to access a device using a libusb-based application

  • you want to upgrade a generic USB driver

  • you want to access a device using WinUSB


If you follow the instructions when flashing a device and don't have the right USB driver installed you'll likely get an error like this:


Cannot open DFU device 0483:df11

That's not a lot to go on. The issue is that the default "inbox" driver that Windows uses for devices like this isn't set up for Generic USB access with libraries like "libusb."

没什么可继续的。 问题是Windows并未为Windows这样的设备使用默认的“收件箱”驱动程序,而无法通过“ libusb”之类的库进行通用USB访问。

为您的设备安装通用USB驱动程序-使用Zadig的WinUSB (Install a generic USB driver for your device - WinUSB using Zadig)

Run Zadig and click Options | List All Devices.

运行Zadig ,然后单击“选项”。 列出所有设备。

Here you can see me finding the ST device within Zadig and replacing the driver with WinUSB. In my case the device was listened under STM32 Bootloader. Be aware that you can mess up your system if you select something like your WebCam instead of the hardware device you mean to select.

在这里,您可以看到我在Zadig中找到ST设备并将驱动程序替换为WinUSB。 就我而言,该设备是在STM32 Bootloader下监听的。 请注意,如果选择WebCam之类的东西而不是要选择的硬件设备,则可能会使系统混乱。

In Zadig, select the STM32 Bootloader

In this state, you can see in the Device Manager that there's an "STM Device in DFU Mode."

在这种状态下,您可以在“设备管理器”中看到“ DFU模式下的STM设备”。

STM Device in DFU Mode

Now I run Zadig and replace the driver with WinUSB. Here's the result. Note the SUCCESS and the changed Driver on the left.

现在,我运行Zadig并将驱动程序替换为WinUSB。 这是结果。 注意成功和更改后的驱动程序在左侧。

Replace it with WinUSB

Here the STM32 Bootloader device now exists in Universal Serial Bus Devices in Device Manager.

此处,STM32 Bootloader设备现在存在于设备管理器的通用串行总线设备中。

STM32 Bootloader

Now I can run dfu-util --list again. Note the before and after in the screenshot below. I run dfu-util --list and it finds nothing. I replace the bootloader with the generic WinUSB driver and run dfu-util again and it finds the devices.

现在,我可以再次运行dfu-util --list。 请注意下面的屏幕快照中的before和after。 我运行dfu-util --list,它什么也没找到。 我将引导加载程序替换为通用的WinUSB驱动程序,然后再次运行dfu-util,它会找到设备。

Flashing devices with dfu-util

At this point I can follow along and flash my devices per whatever instructions my manufacturer/project/boardmaker intends.


Keep dfu-util and libusb together

NOTE: When using dfu-util on Windows, I recommend you either be smart about your PATH and add dfu-util, or better yet, make sure the dfu-util.exe and libusb.dlls are local to your firmware so there's no confusion about what libraries are being used.


I'd love to see this extra step in Windows removed, but for now, I hope this write up makes it clearer and helps the lone Googler who finds this post.


Sponsor: Develop Xamarin applications without difficulty with the latest JetBrains Rider: Xcode integration, JetBrains Xamarin SDK, and manage the required SDKs for Android development, all right from the IDE. Get it today

赞助商:使用最新的JetBrains Rider:Xcode集成,JetBrains Xamarin SDK轻松开发Xamarin应用程序,并直接从IDE管理Android开发所需的SDK。 立即获取


stm dfu


  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
©️2022 CSDN 皮肤主题:大白 设计师:CSDN官方博客 返回首页
钱包余额 0