Skip to content

SPRD Flash Tool v0.1.0

Choose a tag to compare

@ajsb85 ajsb85 released this 12 Jul 02:18
v0.1.0
bc0d0ef

Pure-Rust, cross-platform (Windows 11 + Linux/WSL) native flasher for
SPRD/UNISOC .pac firmware — RDA8910 / UIS8910 (Air724UG and friends) — built
for the manufacturing line and verified end-to-end on real hardware.

Highlights

  • No vendor tool. Speaks the full download protocol directly: PDL (loads
    FDL1) → BSL/FDL2 → partitions → optional cross-SDK --format → reset.
  • Hardware-verified on a real Air724UG (RDA8910): a same-SDK reflash and
    a cross-SDK change (LuatOS V4035 ⇄ CSDK V302340) that boots directly on the
    soft reset with IMEI and NV intact.
  • Manufacturing line orchestrator: one thread per fixture, flashing and
    boot-verifying in parallel, each unit boot-verified (ATI/IMEI) and written as
    one JSON-lines record for the MES/ERP, with yield + throughput metrics and
    automatic recovery of a wedged agent.
  • Sans-I/O core (#![forbid(unsafe_code)]), Rust 2024 edition, MSRV
    1.85, clippy -D warnings clean, CI on Windows + Linux.

What's in the box

Crate Role
sprdflash-core Pure protocol: PAC parse, PDL + BSL framing, checksums, cross-SDK plan
sprdflash-transport serialport byte stream, USB discovery, beacon-window connect, recovery
sprdflash-flash Device driver: PDL → BSL → partitions → format → reset
sprdflash-line Parallel stations, boot-verify, JSON-lines records, metrics
sprdflash-cli The sprdflash binary: info, list-ports, flash, line

Measured speed

6 MB in ~33 s (chunk = 2048), 22% faster than the reference Python (~42 s).
The device is flash-write-bound (~186 KiB/s), so line throughput comes from
per-fixture parallelism (~110 units/hour each) → thousands/day across a bank
of stations.

Usage

# one device, auto mode-switch, boots into the new firmware
sprdflash flash --enter-download firmware.pac
# cross-SDK change (formats FS, refreshes NV, keeps IMEI)
sprdflash flash --enter-download --format firmware.pac
# manufacturing line: parallel stations + MES records
sprdflash line firmware.pac --station f1:COM12 --station f2:COM22 \
    --format --records units.jsonl

ERP / MES integration

Every flashed unit emits one JSON line (schema, PostgreSQL DDL with KPI views,
and a report catalog under docs/). See
docs/erp-mes-data-model.md.

Verification

  • The v0.1.0 tag is SSH-signed (git tag -v v0.1.0).

  • The Windows binary is shipped with a detached SSH signature
    (sprdflash-v0.1.0-x86_64-windows.exe.sig). Verify with:

    ssh-keygen -Y verify -f allowed_signers -I ajsb85@firechip.dev \
        -n file -s sprdflash-v0.1.0-x86_64-windows.exe.sig \
        < sprdflash-v0.1.0-x86_64-windows.exe
    

Signed-off-by: Alexander Salas Bastidas <ajsb85@firechip.dev>