examples/device/dfu/README.md
A USB Device Firmware Upgrade (DFU mode) device with two firmware partitions, demonstrating download, upload and manifestation.
FLASH, alt 1 EEPROM.Hello world from TinyUSB DFU! - Partition 0/1), single block only.| Interface | Class driver |
|---|---|
| 0 | DFU (two alternate settings) |
Notable tusb_config.h settings:
#define CFG_TUD_DFU 1
#define CFG_TUD_DFU_XFER_BUFSIZE (TUD_OPT_HIGH_SPEED ? 512 : 64)
CMake:
mkdir build && cd build
cmake -DBOARD=raspberry_pi_pico ..
cmake --build .
Make:
make BOARD=raspberry_pi_pico all
List the device in DFU mode:
dfu-util -l
Download firmware to a partition (a text file works well for this demo):
dfu-util -d cafe -a 0 -D firmware.bin # partition 0 (FLASH)
dfu-util -d cafe -a 1 -D firmware.bin # partition 1 (EEPROM)
Upload from a partition back to the host:
dfu-util -d cafe -a 0 -U readback.bin
dfu-util -d cafe -a 1 -U readback.bin
Downloaded bytes are echoed on the device's stdout; uploads return the partition's fixed string.