Update stale Build HAT firmware and make version/signature reads timing-independent#2554
Update stale Build HAT firmware and make version/signature reads timing-independent#2554Copilot wants to merge 3 commits into
Conversation
Firmware/signature/version consistency check ✅This PR replaces the full firmware triple atomically — not just the
Upstream provenance — confirmed byte-for-byte against
So the firmware, its signature, and the version string are a single matching set from the same official Raspberry Pi Build HAT release — we are not mixing a new firmware with a stale signature. The old signature bytes in the diff also match the documented value in Residual verification (not provable from source alone):
|
|
Closing in favor of consolidating these changes alongside the ActiveMotor pid fix (#2556). Both pieces from this PR are being carried over verbatim: the firmware refresh to build |
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.