Skip to content

feat: add UF2 uploader for CDC-touch bootloaders - #122

Open
cumin777 wants to merge 2 commits into
stm32duino:mainfrom
cumin777:feat/xiao-stm32c5
Open

feat: add UF2 uploader for CDC-touch bootloaders#122
cumin777 wants to merge 2 commits into
stm32duino:mainfrom
cumin777:feat/xiao-stm32c5

Conversation

@cumin777

Copy link
Copy Markdown

Summary

Add uf2upload, a self-contained C++17 host uploader for STM32 boards using
a USB CDC 1200-bps touch and UF2 mass-storage bootloader.

This PR implements the following features:

  • Convert a firmware .bin image to UF2 with board-supplied address,
    family ID and maximum-size validation
  • Detect an already-mounted UF2 volume, or perform a CDC 1200-bps touch
    and wait for the bootloader volume before copying the UF2 image
  • Add Windows and Linux x86_64 tool artifacts

Arduino_Core_STM32 can describe an UF2 upload recipe, but STM32Tools currently
has no uploader that can perform the complete CDC-touch, UF2 conversion and
mass-storage-copy flow. This tool provides that missing user-facing upload
path without requiring Python or shell dependencies at upload time.

On Windows, uf2upload tolerates the transient serial error caused by the
expected reset after the 1200-bps touch and continues waiting for the UF2 volume.

Validation

Validated on a Seeed XIAO STM32C5 running the TinyUF2 bootloader:

  • Upload when the XIAOC5BOOT volume is already mounted
  • Full automatic flow from a running application: CDC 1200-bps touch,
    bootloader entry, UF2 conversion and copy
  • Windows serial-reset status reporting during the device reset transition

The Windows and Linux x86_64 artifacts are included. macOS build integration is
included, but a macOS artifact and hardware validation are not part of this PR.

CI and AStyle checks are pending GitHub Actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant