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具有强大的支持

However.

然而。

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

多年来-我说-当您想通过USB刷新各种设备的固件时,Windows一直是一个很大的麻烦。

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.

Mac和Linux指令通常会说“插入并加入聚会”之类的内容,但像Windows一样的人必须安装WinUSB驱动程序(libusb-win32或libusbK),因为dfu-util使用这些库与USB设备对话。

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

    您要使用基于libusb的应用程序访问设备
  • you want to upgrade a generic USB driver

    您要升级通用USB驱动程序
  • you want to access a device using WinUSB

    您要使用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:

如果您在刷新设备时遵循说明,但未安装正确的USB驱动程序,则可能会出现如下错误:

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.

注意:在Windows上使用dfu-util时,建议您对PATH有所了解并添加dfu-util,或者更好的是,确保dfu-util.exe和libusb.dll在固件本地,所以不要混淆。关于正在使用哪些库。

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.

我希望看到Windows中的这一额外步骤已删除,但现在,我希望本文能使内容更清楚,并帮助找到这篇文章的孤独的Googler。

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。 立即获取

翻译自: https://www.hanselman.com/blog/how-to-fix-dfuutil-stm-winusb-zadig-bootloaders-and-other-firmware-flashing-issues-on-windows

stm dfu

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值