feat: add UF2 uploader for CDC-touch bootloaders - #122
Conversation
|
Arduino_Core_STM32 follow-up: generic UF2 upload recipe is now split into core PR #3061, and XIAO STM32C5 board support is #3048. The core recipe invokes the |
|
Thanks for the PR. |
|
I have added a Linux ARM64/AArch64 The ARM64 artifact was cross-compiled on Ubuntu 24.04 under WSL2 (x86_64), checked as an AArch64 ELF, and executed under QEMU user-mode emulation with an ARM64 sysroot. But physical ARM64 USB CDC and TinyUF2 hardware upload have not been validated yet. I also completed Linux x86_64 validation on Ubuntu 24.04.3 under WSL2. The following all passed:
And the Windows build and upload flow have also been exercised in my regular Windows development environment. Arduino Core is not required for these host-tool tests. It is only needed when reproducing the complete Arduino compile-and-upload workflow with a real xiao-STM32C5 board. |
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:
.binimage to UF2 with board-supplied address, family ID and maximum-size validationArduino_Core_STM32 can describe a 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,
uf2uploadtolerates the transient serial error caused by the expected reset after the 1200-bps touch and continues waiting for the UF2 volume.The Linux ARM64 artifact is cross-compiled from the same source with the AArch64 GNU toolchain and is placed at
linux/aarch64/uf2upload. The build scripts and Dockerfile also include this artifact in the ARM64 tool build.Validation
Validated on a Seeed XIAO STM32C5 running the TinyUF2 bootloader:
XIAOC5BOOTvolume is already mountedThe Linux x86_64 host build was compiled and functionally exercised under Ubuntu 24.04 on WSL2. The Linux ARM64 binary was cross-compiled on x86_64 and executed under QEMU user-mode emulation for command-line, UF2 generation, simulated volume discovery and file-copy checks. Physical ARM64 USB CDC and TinyUF2 hardware upload have not been validated.
Packaging notes
The Windows and Linux x86_64 artifacts are included, together with the Linux ARM64/AArch64 artifact. macOS build integration is included, but a macOS artifact and hardware validation are not part of this PR.
Arduino_Core_STM32 follow-up PR #3061 consumes this executable from STM32Tools. After this PR merges, a corresponding STM32Tools release/package-index update is still required before end users can install the tool through Board Manager.
CI and AStyle checks are pending GitHub Actions.