Skip to content

FWDFU pre-update + plan 0004 (SD-direct OTA staging spike) — BETA test vehicle - #118

Merged
TheAngryRaven merged 3 commits into
BETAfrom
claude/uf2-dfu-command-beta
Aug 2, 2026
Merged

FWDFU pre-update + plan 0004 (SD-direct OTA staging spike) — BETA test vehicle#118
TheAngryRaven merged 3 commits into
BETAfrom
claude/uf2-dfu-command-beta

Conversation

@TheAngryRaven

Copy link
Copy Markdown
Owner

Summary

BETA twin of #117 (same FWDFU commit, cherry-picked) plus docs/plans/0004-sd-direct-ota-staging.md — the spike plan for staging OTA images straight from the SD card (/fw/pending.bin is already there, verified) so the 320 KB internal-flash staging region can be deleted and the app region grows to ~820 KB. The plan covers the pre-resolved sector-run approach for the RAM flasher, the four Phase-0-style hardware spikes required, and the sequencing (FWDFU now → spike → implement → fallback = staging-layout move).

This branch is the test vehicle: bench-verify FWDFU here (BLE command → FWDFU:OK → XIAO-SENSE UF2 drive → drag a .uf2 → flashed; exit-without-flashing boots the app unchanged) before #117 lands on master.

Type of change

  • Bug fix (no user-visible behavior change beyond the fix)
  • New feature / behavior
  • Refactor (no behavior change)
  • Tests only
  • CI / tooling / docs
  • Breaking change (track files, log format, BLE protocol, or a removed mode)

How it was verified

  • Host unit tests pass (ctest --test-dir tests/build) — unaffected (no pure-logic change)
  • clang-tidy clean — deferred to CI
  • Compiles for the XIAO nRF52840 Sense — deferred to CI (BETA build, flag-on)
  • Tested on real hardware — this PR is that test: see the bench checklist above

Checklist

  • CHANGELOG.md updated under [Unreleased] (if user-visible)
  • ARCHITECTURE.md / CLAUDE.md updated (if a module or interface changed)
  • New testable logic has a matching test in tests/ — N/A (register write + reset)
  • Branch is focused

Related issues

Master twin: #117. Design: docs/plans/0004-sd-direct-ota-staging.md (this PR). Context: #116's OTA size-gate incident.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HnTP6BdA9xjLR5hSWE9frb


Generated by Claude Code

claude and others added 3 commits August 2, 2026 23:34
…e escape hatch)

Rebooting with GPREGRET=0x57 (DFU_MAGIC_UF2_RESET, stock on the
Adafruit/Seeed bootloader) brings the device up as a USB drive; copying
a .uf2 flashes the app region directly - no image-size cap, no staging
region, no web/BLE streaming. Deferred to the main loop like every FW
command; acknowledges FWDFU:OK before the reboot, cleanly aborts any
in-flight OTA first, and uses the same sd_power_gpregret SV-call
pattern as the apply path's recovery flag. Groundwork for the SD-staged
OTA rework: fleet units that take this update always have a
size-unlimited update path over a USB cable.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HnTP6BdA9xjLR5hSWE9frb
… design)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HnTP6BdA9xjLR5hSWE9frb
@TheAngryRaven
TheAngryRaven merged commit 8c31bbc into BETA Aug 2, 2026
8 checks passed
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

Coverage — host-testable units

📂 Overall coverage

Metric Coverage
Lines 🟢 822/832 (98.8%)
Functions 🟢 88/88 (100.0%)
Branches 🟢 665/731 (91.0%)

📄 File coverage

File Lines Functions Branches
BirdsEye/camera_fsm.cpp 🟢 222/230 (96.5%) 🟢 20/20 (100.0%) 🟡 126/144 (87.5%)
BirdsEye/crc32.cpp 🟢 30/30 (100.0%) 🟢 4/4 (100.0%) 🟢 24/24 (100.0%)
BirdsEye/dovex_header.cpp 🟢 106/107 (99.1%) 🟢 7/7 (100.0%) 🔴 62/88 (70.5%)
BirdsEye/filename_validator.cpp 🟢 14/14 (100.0%) 🟢 1/1 (100.0%) 🟢 30/30 (100.0%)
BirdsEye/gps_stats.cpp 🟢 25/25 (100.0%) 🟢 3/3 (100.0%) 🟢 8/8 (100.0%)
BirdsEye/gps_status_page.cpp 🟢 25/25 (100.0%) 🟢 3/3 (100.0%) 🟢 24/24 (100.0%)
BirdsEye/gps_time.cpp 🟢 45/45 (100.0%) 🟢 6/6 (100.0%) 🟢 30/32 (93.8%)
BirdsEye/gps_validation.cpp 🟢 24/24 (100.0%) 🟢 2/2 (100.0%) 🟢 66/66 (100.0%)
BirdsEye/haversine.cpp 🟢 8/8 (100.0%) 🟢 1/1 (100.0%) ⚫ 0/0 (0.0%)
BirdsEye/insta360_protocol.cpp 🟢 140/140 (100.0%) 🟢 16/16 (100.0%) 🟡 86/98 (87.8%)
BirdsEye/lap_format.cpp 🟢 18/18 (100.0%) 🟢 1/1 (100.0%) 🟢 9/9 (100.0%)
BirdsEye/sat_bars.cpp 🟢 33/33 (100.0%) 🟢 2/2 (100.0%) 🟢 51/54 (94.4%)
BirdsEye/sd_access_policy.cpp 🟢 9/9 (100.0%) 🟢 3/3 (100.0%) 🟢 18/18 (100.0%)
BirdsEye/sd_format_page.cpp 🟢 25/25 (100.0%) 🟢 3/3 (100.0%) 🟢 25/26 (96.2%)
BirdsEye/sensoregg_protocol.cpp 🟢 44/45 (97.8%) 🟢 7/7 (100.0%) 🟢 33/34 (97.1%)
BirdsEye/sprint_select.cpp 🟢 25/25 (100.0%) 🟢 4/4 (100.0%) 🟢 46/48 (95.8%)
BirdsEye/tach_filter.cpp 🟢 15/15 (100.0%) 🟢 3/3 (100.0%) 🟡 7/8 (87.5%)
BirdsEye/wake_cause.cpp 🟢 14/14 (100.0%) 🟢 2/2 (100.0%) 🟢 20/20 (100.0%)

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.

2 participants