Skip to content

Stamp firmware with git hash: boot log, /debug page - #23

Merged
sven97 merged 1 commit into
mainfrom
firmware-version-log
Aug 14, 2026
Merged

sven97 merged 1 commit into
mainfrom
firmware-version-log

Conversation

@sven97

@sven97 sven97 commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • Stamps every build with the git commit it came from (short hash, -dirty suffix on uncommitted changes) instead of a hand-maintained version number.
  • tools/version.py runs as a PlatformIO pre-build hook, injecting FW_GIT_HASH for all board envs via xiao_base.
  • Surfaced as the first line of the boot log (/log, /debug) and a new header on the /debug page.
  • Documented in docs/versioning.md; README's debug-route table updated.

Verification

  • pio run -e ee02 -e ee03 -e ee04 -e ee05 — all build clean.
  • pio test -e native — 79/79 pass (regression check; unaffected logic).
  • Confirmed the embedded hash matches git rev-parse --short=8 HEAD via strings on the built ELF.
  • Flashed a connected EE02 and confirmed over Wi-Fi:
    • curl http://ee02.local/log → open-xiao-epaper: boot #1, wake: power-on, firmware: eb174428-dirty
    • curl http://ee02.local/debug → header EE02 · firmware eb174428-dirty

🤖 Generated with Claude Code

No manual version number to forget to bump -- tools/version.py runs as
a PlatformIO pre-build hook and embeds the short git commit hash
(plus -dirty if the tree has uncommitted changes) as FW_GIT_HASH,
shared by all board envs via xiao_base. Falls back to "unknown"
outside a git checkout.

Surfaced as the first line of the boot log (/log, /debug) and in a
new header on the /debug page. Verified end-to-end on a flashed EE02
over Wi-Fi. See docs/versioning.md.
@sven97
sven97 merged commit 892faa6 into main Aug 14, 2026
5 checks passed
@sven97
sven97 deleted the firmware-version-log branch August 14, 2026 00:01
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