Skip to content

feat: SD card firmware update (OTA from removable media) #101

@dougborg

Description

@dougborg

Summary

Support firmware self-update from an SD card at boot. Place airhound.bin on the SD card, insert it, and the device flashes itself. Simple but effective for field-deployed sensors without network connectivity.

Inspired by ESP32DualBandWardriver's SD card OTA update mechanism.

Design

  1. On boot, check SD card root for airhound.bin (or versioned: airhound-v1.2.3.bin)
  2. Verify firmware image integrity (SHA-256 checksum, or signature for supply-chain safety)
  3. Flash to the inactive OTA partition (ESP-IDF A/B partition scheme for rollback safety)
  4. Mark new partition as boot target
  5. Delete or rename the .bin file to prevent reflash loop
  6. Reboot into new firmware

Progress Indication

  • M5StickC: Display flash progress (percentage bar)
  • XIAO: LED blink pattern during flash
  • Both: Serial log output for debugging

Hardware Requirements

  • Requires SD card slot — not all boards have one natively
    • XIAO ESP32-S3 has microSD via expansion board
    • M5StickC Plus2 does not have SD (would need external SPI SD module)
  • SPI SD card driver needed (or SDMMC on supported chips)

Safety

  • A/B OTA partitions ensure rollback if new firmware fails to boot
  • Checksum verification prevents flashing corrupt images
  • Optional: require a signature file (airhound.bin.sig) for verified updates
  • Boot count watchdog: if new firmware crashes N times, revert to previous

Relates To

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions