dfu-libusb 0.6.0

Implementation of DFU using libusb and dfu-core
Documentation
dfu-libusb-0.6.0 has been yanked.

Rust Latest Version License Docs.rs Changelog Dependency Status

dfu-libusb

Flash firmware to USB devices using the DFU (Device Firmware Upgrade) protocol.

Built on dfu-core for the protocol implementation and rusb for USB access via libusb.

Features

Usage

[dependencies]
dfu-libusb = "0.5"
use rusb::Context;
use dfu_libusb::DfuLibusb;

let context = Context::new()?;
let firmware = std::fs::read("firmware.bin")?;
let size = firmware.len() as u32;

let mut dfu = DfuLibusb::open(&context, 0x1234, 0x5678, 0, 0)?;
dfu.download(std::io::Cursor::new(firmware), size)?;

See the download example for a more complete program with a progress bar, wait-for-device, and post-flash reset; and describe to inspect a device's functional descriptor.

License

MIT OR Apache-2.0