Repository navigation
Conversation
On Pi 5 / CM5, `vcgencmd otp_dump` starts at row 00, skips rows 61-76 and 93-108, and has three digit row numbers from 109 up. ReadOTP assumed the dump starts at row 08, is contiguous and that every row number has two digits, so: - `otpset -c` and `otpset -p` crash with "ValueError: invalid literal for int() with base 16: b':19a519a6'" - before crashing, `otpset -c` prints rows 28-35 as customer rows 0-7, which on CM5 includes the serial number and revision code, while the real customer OTP is all zero Parse the row number from each "<row>:<value>" line instead of the line index, read the customer rows with the documented mailbox call (0x00030021) rather than assuming where they are in the dump, and drop the BCM2711 row labels on BCM2712 where they don't apply. Output with --fake is unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Roy <rongh7426@gmail.com>
Contributor
Author
|
Also checked on a Pi 5, which has a newer package than the CM5 above (Raspberry Pi 5 Model B Rev 1.1, revision
So the crash is still there in the current package, and the same fix covers both BCM2712 boards I have. |
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.
On Pi 5 / CM5,
vcgencmd otp_dumpstarts at row 00, skips rows 61-76 and 93-108, and uses three digit row numbers from 109 up.ReadOTPassumes the dump starts at row 08, is contiguous and that every row number has two digits (val[3:]), so on BCM2712:otpset -candotpset -pcrash:otpset -cprints dump rows 28-35 as customer rows 0-7. On the CM5 below that shows the serial number as customer row 3 and the revision code as customer row 4, while the real customer OTP is all zero:This PR:
<row>:<value>line instead of using the line index0x00030021) instead of assuming where they sit in the dumpTested on a CM5 (Compute Module 5 Rev 1.0, revision
c04180, raspi-utils20251120-1, Debian trixie):otpset -cotpset -potpset -f -c/otpset -f -potpset -c/-pwithout sudo (user invideo)otpset -v -r 0 0x1(dry run)I don't have a Pi 4 to hand, so the BCM2711 path is only covered by
--fake; the mailbox read for-cis the one the OTP documentation gives for all models.🤖 Generated with Claude Code