Repository navigation
v0.2.0
Added
-
eeprom-writeandeeprom-read: program and dump a serial EEPROM
on the HAT ID bus (BSC0 on GPIO0/1,ID_SD/ID_SC), which is where a
board's identity lives — the HAT specification's image, and whatever a
design puts beside it.eeprom-writetakes the.eepfileeepmake
produces;eeprom-readwith no--lengthreads the image length out
of the HAT header first, rather than dumping the whole address space.
Both take--address(default0x50) and--offset; the write also
takes--page-size(default 32, safe for every part from the 24C32 up).The device reads every page back after programming it and fails the
command on a mismatch, because a write-protected part acknowledges
every byte and stores none — without the read-back, writing to one
would report success and change nothing.New wire commands
EEPROM_READ(9) andEEPROM_WRITE(10), and error
codes 7 (I2C transfer failed), 8 (read-back mismatch), 9 (a request
outside what the device will address) and 10 (the part never answered
the read-back).
Changed
-
The handshake's protocol version is now 2, in both halves. It is a
bump for an addition rather than a change, which the version byte
cannot express — but the mismatch it names is the ordinary one for this
project, not an exotic one: the loader image is flashed once and left on
the card for months while the CLI is reinstalled from crates.io
whenever, so a newer CLI meeting an older loader is the expected way for
the two to drift.Without it,
eeprom-writeagainst a 0.1.0 loader comes back as
error code 0— the unknown command byte answered withFAIL— which
reads as a fault on the I2C bus rather than as a stale image on the SD
card. With it, the handshake saysdevice protocol version 1, expected 2first. A mismatch stays a warning, so an older CLI keeps driving a
newer loader for every command they share.
Fixed
- Terminal mode no longer puts the invoking terminal into raw mode when
stdin is not a terminal.crossterm'senable_raw_modedoes not consult
stdin — on Unix it falls back to opening/dev/tty— so redirecting stdin
did not prevent it, and a caller that stopped the loader with a signal
never reached the restore, handing back a shell with no echo and\nno
longer implying\r. Affected anything drivingbootorterminalfrom
a script rather than a keyboard.
Images
Copy the image matching your board to the SD card's boot
partition, renamed to kernel7.img (32-bit) or kernel8.img
(64-bit) -- the firmware loads those names and no others. Use
kernel8.img only with arm_64bit=1 in config.txt.
bcm2837 covers the Pi 2 v1.2 and Pi 3; bcm2711 covers the
Pi 4. Verify with sha256sum -c SHA256SUMS.
The host CLI is a separate install: cargo install rpi-loader.