SD watchdog follow-ups + release-build guards - #165
Open
TheAngryRaven wants to merge 5 commits into
Open
TheAngryRaven wants to merge 5 commits into
TheAngryRaven wants to merge 5 commits into
Conversation
scanTrackDir() opens and ArduinoJson-parses every file under /TRACKS and /TRACKS/SPRINT (up to MAX_LOCATIONS, 8 KB each at the 2 MHz SPI clock) inside one call. setup() only pets before and after buildTrackList(), so on a soft-reset boot — where the WDT carried over from the previous session is already counting (#163) — a large track set or a slow card could outlast the ~4 s deadline and reset the device mid-SD-read: the exact card wedge #163 exists to prevent. The same walk re-runs after a BLE track upload/delete with the WDT armed. Feed it per directory entry. Audit of the other SD walks reachable at boot or under the armed WDT: - ensureDefaultSettings(): one full file round trip per key (~25) inside SETTINGS_SETUP() — now fed per key. - buildReplayFileList(): capped by .dovex files FOUND, not entries scanned, so unbounded over a busy root — now fed per entry. - fwCrcOfStageFile(): reads back up to a 408 KiB image in 512 B blocks in one loop() iteration — now fed per block. - BLE LIST/TLIST already feed per entry; parseTrackFile, the course creator write and sdPlanSprintPrune are a single bounded file each. wdtPet() is a plain register write, a no-op before the WDT runs, and is already prototyped for the sim TU (sim_prototypes.h). No host test: the pets are Arduino glue with nothing pure to extract. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SdhRyfZ4eYuooXi9uy28aw
HAS_DEBUG builds block in setup() on `while (!Serial);` right after the single wdtBootCheck() pet. After a soft reset the WDT carried over from the previous session is already counting, so with no terminal attached the wait outlived the ~4 s deadline and the device reset — into the same wait, forever. Feed it inside the wait. No other unbounded busy-wait sits on the setup() path (the NVMC READY spins in the one-time UICR write are microseconds, and setup() pets around that step already). Developer builds only; nothing shipped defines HAS_DEBUG. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SdhRyfZ4eYuooXi9uy28aw
compile-sketch.yml said a master/release build needed "a DovesLapTimer release tag carrying CrossingEngine/SprintTimer" before BETA could be promoted, and justified the flags-off arm's BETA library ref with "pinning the release tag would fail on BETA-era library APIs". Both stopped being true with v4.3.0: its src/ is byte-identical to the library's BETA branch (git diff v4.3.0 origin/BETA -- src is empty). CLAUDE.md's Simulator table also said the sim's CMakeLists pins DovesLapTimer BETA "(matches CI channel)", but it defaults DOVESLAPTIMER_REF to v4.3.0 and sim-build.yml overrides it to BETA only for BETA-targeted builds. Stale pin notes are how the wrong library gets shipped, so reword them to what is true and name every place the pin lives. Comments/docs only. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SdhRyfZ4eYuooXi9uy28aw
The release PR's CI never built what release.yml ships. Its `compile` job correctly follows the SOURCE channel (BETA library + beta flags), and the flags-off `compile-stock-arm` job linked the library's BETA branch and built the Sense board only. So BETA source met the pinned release library (v4.3.0) — and the non-Sense board met the flags-off configuration — for the first time on the tag push, after the merge. compile-stock-arm is now a matrix over both boards, and on the release PR (head_ref == BETA) it links the release pin instead of BETA, with exactly release.yml's extra_flags. On feature PRs into BETA and BETA pushes it keeps the BETA library so the flags stay the only variable. The Sense job keeps its old check name. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SdhRyfZ4eYuooXi9uy28aw
release.yml derives the OTA manifest's version from the git tag, but
the image reports FIRMWARE_VERSION from BirdsEye/project.h over BLE, and
nothing tied the two together. Tagging v4.2.0 on a tree whose project.h
still says "4.1.0" published a manifest no device could ever satisfy:
every unit would install the update, still report 4.1.0, and be offered
it again forever.
Add a first step to the build job, tag builds only, that extracts the
quoted literal from the non-override FIRMWARE_VERSION branch (asserting
exactly one exists), fails unless it equals ${GITHUB_REF_NAME#v}, and
also requires a `## [x.y.z]` CHANGELOG heading. It fails before the
compile, and release/pages need `build`, so nothing is published.
Manual (workflow_dispatch) runs have no tag and skip it. The version
number itself is unchanged.
Verified locally by running the step's script against v4.1.0 (pass),
v4.2.0 and v4.0.0 (version mismatch), and a patched tree at 9.9.9 with
no CHANGELOG heading (heading failure).
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdhRyfZ4eYuooXi9uy28aw
Coverage — host-testable units📂 Overall coverage
📄 File coverage
|
14 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Dove · project thread
Summary
Follow-ups to #163 from the 4.2.0 release review of #160. One commit per finding so each can be cherry-picked or reverted on its own.
Before: after a soft reset the carried-over watchdog could still fire during the boot track scan on a big track set or slow card, which lands mid-SD-read and causes the wedge #163 fixes. A
HAS_DEBUGbuild reset forever with no terminal attached. The BETA → master PR never compiled BETA source the wayrelease.ymlbuilds it, and a tag that disagreed withproject.hwould publish an update devices could never satisfy.After: every unbounded SD walk feeds the watchdog, the release PR compiles the exact release configuration for both boards, and a mismatched tag fails before anything is built or published.
scanTrackDir()fed per entry; audit also feedsensureDefaultSettings()(per key),buildReplayFileList()(per entry) and the OTA stage-file CRC readback (per 512 B block)while (!Serial) wdtPet();src/is identical to the library's BETA; comments in compile-sketch.yml and the CLAUDE.md sim row said otherwisehead_ref == BETA) it uses the release library pin v4.3.0 andrelease.yml's exact flagsproject.h's literal == tag and that CHANGELOG has a## [x.y.z]headingThe version number itself is not changed here. It still needs setting before tagging.
Type of change
How it was verified
ctest --test-dir tests/build)clang-tidyclean (CI)Also: the native sim passes all 6 ctests, both workflow YAMLs parse, and the tag-check script was run locally (v4.1.0 passes; v4.2.0 fails on the version; a bumped
project.hwith no CHANGELOG heading fails on the CHANGELOG). The watchdog feeds are Arduino-only code with no pure logic to unit-test.Checklist
CHANGELOG.mdupdated under[Unreleased](if user-visible)ARCHITECTURE.md/CLAUDE.mdupdated (if a module or interface changed)tests/(no new pure logic)Related issues
Follow-up to #163; findings from the #160 release review.
🤖 Generated with Claude Code
https://claude.ai/code/session_01SdhRyfZ4eYuooXi9uy28aw
Generated by Claude Code