Skip to content

feat: Firmware update via USB (DFU mode) #22

@cursor

Description

@cursor

Feature Description

Enable firmware updates without physically pressing BOOTSEL button.

Motivation

  • Easier firmware updates
  • Remote updates possible
  • Better user experience
  • Professional feature

Implementation Options

Option A: USB DFU (Device Firmware Update)

  • Standard USB DFU protocol
  • Use dfu-util on Linux
  • Supported by TinyUSB
  • Industry standard

Option B: Custom Bootloader

  • Custom USB protocol
  • Smaller footprint
  • More control over process

Option C: UF2 Upload via HID

  • Upload UF2 file via HID reports
  • Write to flash
  • Reboot automatically

Usage

Linux

# Enter DFU mode
pico-fan-ctl firmware update-mode

# Flash new firmware
dfu-util -a 0 -D pico_fan_hub_v1.1.0.uf2

# Or automated:
pico-fan-ctl firmware flash pico_fan_hub_v1.1.0.uf2

Safety Features

  • Checksum verification
  • Dual-partition fallback
  • Bootloader protection
  • Recovery mode
  • Never brick the device

Implementation Notes

  • Partition flash: Bootloader + App
  • Reserve ~16KB for bootloader
  • Use RP2040 reset to bootloader
  • TinyUSB DFU class

Acceptance Criteria

  • Enter DFU mode via USB command
  • Update firmware without BOOTSEL button
  • Checksum verification
  • Safe rollback on failure
  • CLI tool support
  • Documentation

Priority

Low - Convenience feature

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions