DFU
+ -

DFU-UTIL

2026-10-23 本文链接为:http://www.usbzh.com/article/detail-1816.html ,欢迎转载,转载请附上本文链接。

dfu-util 是开源的,采用 GPLv2 许可证。它是一个命令行工具,用于在主机(PC)端实现 USB DFU 协议,以便向设备下载或上传固件.

源码:https://dfu-util.sourceforge.net/

git clone git://git.code.sf.net/p/dfu-util/dfu-util
USB中文网备用:http://www.usbzh.com/download/tool/dfu/dfu-util-master.zip

编译好的应用:https://sourceforge.net/projects/dfu-util/files/latest/download

USB中文网备用:http://www.usbzh.com/download/tool/dfu/dfu-util-0.11-binaries.tar.xz

在 Linux(如 Debian/Ubuntu)或 macOS(Homebrew)上,通常可以直接通过包管理器安装(例如 apt install dfu-util 或 brew install dfu-util)

linux用户如ubuntu

sudo apt-get install dfu-util

mac os

brew install dfu-util

安装成功后,可以通过输入 dfu-util -V 来测试工具是否正常工作

C:\dfu\win64>dfu-util.exe
dfu-util 0.11

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

You need to specify one of -D or -U
Usage: dfu-util [options] ...
  -h --help                     Print this help message
  -V --version                  Print the version number
  -v --verbose                  Print verbose debug statements
  -l --list                     List currently attached DFU capable devices
  -e --detach                   Detach currently attached DFU capable devices
  -E --detach-delay seconds     Time to wait before reopening a device after detach
  -d --device <vendor>:<product>[,<vendor_dfu>:<product_dfu>]
                                Specify Vendor/Product ID(s) of DFU device
  -n --devnum <dnum>            Match given device number (devnum from --list)
  -p --path <bus-port. ... .port>       Specify path to DFU device
  -c --cfg <config_nr>          Specify the Configuration of DFU device
  -i --intf <intf_nr>           Specify the DFU Interface number
  -S --serial <serial_string>[,<serial_string_dfu>]
                                Specify Serial String of DFU device
  -a --alt <alt>                Specify the Altsetting of the DFU Interface
                                by name or by number
  -t --transfer-size <size>     Specify the number of bytes per USB Transfer
  -U --upload <file>            Read firmware from device into <file>
  -Z --upload-size <bytes>      Specify the expected upload size in bytes
  -D --download <file>          Write firmware from <file> into device
  -R --reset                    Issue USB Reset signalling once we're finished
  -w --wait                     Wait for device to appear
  -s --dfuse-address address<:...>      ST DfuSe mode string, specifying target
                                address for raw file download or upload (not
                                applicable for DfuSe file (.dfu) downloads).
                                Add more DfuSe options separated with ':'
                leave           Leave DFU mode (jump to application)
                mass-erase      Erase the whole device (requires "force")
                unprotect       Erase read protected device (requires "force")
                will-reset      Expect device to reset (e.g. option bytes write)
                force           You really know what you are doing!
                <length>        Length of firmware to upload from device
  • dfu-util -l :列出所有DFU兼容的USB设备。
  • dfu-util -d, —device :指定操作的设备ID。
  • dfu-util -a, —alt-alt :指定固件文件的备选设置(Alternate Setting)。
  • dfu-util -R, —reset :在上传或下载操作完成后重启设备。
  • dfu-util -i, —idVendor :指定操作的设备的Vendor ID。
  • dfu-util -t, —transfer-size :设置数据传输块的大小。
  • dfu-util -s, —segment addr :指定加载固件的内存段地址。
  • dfu-util -D, —download file :下载文件到设备。

下载文件命令:

dfu-util -a 0 -D firmware-file.dfu

参考文章

https://blog.csdn.net/weixin_30653091/article/details/148936324
https://github.com/Stefan-Schmidt/dfu-util
https://dfu-util.sourceforge.net/dfu-util.1.html
https://sourceforge.net/projects/dfu-util/files/latest/download
https://blog.csdn.net/caoronggui1/article/details/126596872

本文链接为:http://www.usbzh.com/article/detail-1816.html ,欢迎转载,转载请附上本文链接。

HID人机交互QQ群:564808376    UAC音频QQ群:218581009    UVC相机QQ群:331552032    BOT&UASP大容量存储QQ群:258159197    STC-USB单片机QQ群:315457461    USB技术交流QQ群2:580684376    USB技术交流QQ群:952873936     USB技术交流3:1031974172

0 篇笔记 写笔记

DFU-UTIL
dfu-util 是开源的,采用 GPLv2 许可证。它是一个命令行工具,用于在主机(PC)端实现 USB DFU 协议,以便向设备下载或上传固件.源码:https://dfu-util.sourceforge.net/git clone git://git.code.sf.net/p/dfu......
关注公众号
  • HID人机交互
  • Linux&USB
  • UAC音频
  • CDC
  • TYPE-C
  • USB规范
  • USB大容量存储
  • USB百科
  • USB周边
  • UVC摄像头
  • Windows系统USB
  • USB资源
  • 音视频博客
  • 取消
    感谢您的支持,我会继续努力的!
    扫码支持
    扫码打赏,你说多少就多少

    打开支付宝扫一扫,即可进行扫码打赏哦

    您的支持,是我们前进的动力!