Update stale Build HAT firmware and make version/signature reads timing-independent#2554
Draft
Copilot wants to merge 3 commits into
Draft
Update stale Build HAT firmware and make version/signature reads timing-independent#2554Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Copilot
AI
changed the title
[WIP] Fix Build HAT firmware signature error on initialization
Update stale Build HAT firmware and make version/signature reads timing-independent
Jun 2, 2026
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.
Instantiating a
BrickthrowsIOException: BuildHat firmware signture errorfromGetBuildHatInformation(), even when the Python library has already flashed firmware. Two causes: the firmware bundled with the binding is stale (2021), and version/signature parsing depends on serial timing that breaks on faster boards (e.g. Raspberry Pi 5).Changes
src/devices/BuildHat/data/{firmware.bin,signature.bin,version}) to the current official build1737564117(2025-01-22), matching the binaries shipped byRaspberryPiFoundation/python-build-hat(md5sums verified identical).GetRawVersion/GetRawSignaturetiming-independent. They previously usedReadExisting/ a fixed count ofReadLinecalls, which races against the device on fast hosts. They now read whole lines (blocking on the\r\nterminator) until the expected marker appears, skipping interleaved echo, prompt, and asynchronous port lines — the same strategy the Python library uses.Notes
Contains(notStartsWith) is kept deliberately, consistent with the existing marker checks in this file and safe if the firmware prepends a prompt to the answer line.