Skip to content

SPRD Flash Tool v0.4.0

Choose a tag to compare

@github-actions github-actions released this 12 Jul 04:44
v0.4.0
8d69f80

High-assurance flashing and unattended line operation.

This release adds a byte-for-byte read-back check for units that need it, a
continuous "run all shift" line mode, and a hardware-free test path that
exercises the entire flash protocol in CI with no device attached.

Highlights

🔎 Post-write read-back verify — --verify-readback

After each partition is written, its bytes are read straight back off the device
with the BSL READ_FLASH command and compared to the source image. Any
difference fails the flash immediately with read-back verify failed for <partition>, so a marginal cable, a flaky USB hub, or a bad flash block is
caught on the line instead of in the field.

It roughly doubles flash time, so it is off by default — reserve it for
high-assurance builds or fixture bring-up.

sprdflash flash firmware.pac --format --verify-readback

♾️ Continuous line mode — --loop

Runs the line unattended: each station keeps flashing units, waiting for the
operator to swap in the next module between cycles, until you press Ctrl-C.
The stop is graceful — in-flight units finish and their records are written
before exit. Pair it with --metrics-addr so a Prometheus/Grafana board watches
yield and throughput live for the whole shift.

sprdflash line firmware.pac \
    --station fixture-1:COM12 --station fixture-2:COM22 \
    --format --loop --metrics-addr 0.0.0.0:9184 \
    --records /var/log/flash/units.jsonl

Memory stays bounded no matter how long it runs: records stream to the JSONL
sink and fold into the metrics counters, with only a recent tail kept in memory
for the summary. A short floor between cycles keeps a misconfigured or empty line
from busy-spinning.

🧪 Hardware-free end-to-end tests

The serial byte stream now sits behind a Transport trait, and a new
MockTransport speaks just enough of the PDL and BSL protocols to drive a
complete PDL → BSL → partitions → format → reset flash with no device
attached
. CI now covers the happy path, adaptive-retry recovery after a
dropped ack, and both the passing and corruption-detected read-back paths.

Verifying downloads

Every binary ships with a detached SSH signature (.sig) made with the
maintainer's Ed25519 key (SHA256:1wCKrSPq3V4q7DkiomqRJKzr6Vc1bY+eKU1qRvEvGKk,
signature namespace file):

# one-time: trust the signing key
echo 'ajsb85@firechip.dev ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJXmKlNp62mfIFNHT4Duv6vcTwfqb/M6OUs34upSpN/L' > allowed_signers

ssh-keygen -Y verify -f allowed_signers -I ajsb85@firechip.dev -n file \
    -s sprdflash-v0.4.0-x86_64-unknown-linux-gnu.sig \
    < sprdflash-v0.4.0-x86_64-unknown-linux-gnu
# -> Good "file" signature for ajsb85@firechip.dev

Each binary also carries keyless Sigstore build provenance
from GitHub Actions, verifiable with gh attestation verify <file> --repo ajsb85/sprdflash-rs.

Changes

  • feat(flash): optional post-write read-back verification (--verify-readback)
  • feat(line): continuous unattended mode with graceful stop (--loop)
  • test(flash): protocol mock and end-to-end flash tests
  • refactor(transport): abstract the byte stream behind a Transport trait

Assets

Platform Binary
Windows x86-64 sprdflash-v0.4.0-x86_64-pc-windows-msvc.exe
Linux x86-64 sprdflash-v0.4.0-x86_64-unknown-linux-gnu
macOS Apple Silicon sprdflash-v0.4.0-aarch64-apple-darwin
macOS Intel sprdflash-v0.4.0-x86_64-apple-darwin

Full Changelog: v0.3.0...v0.4.0