Hi there,

On Sun, Mar 1, 2026 at 5:47 AM Abdelkader Boudih <[email protected]>
wrote:

> Hi,
>
> I would like to propose a small CLI addition: --verify-reads[=<count>].
>
> When reading flash over an external programmer, a single successful read
> is not proof the data is correct (i learned the lesson when i lost bios
> original).
>
> This is particularly common with:
>
> - Clip-on programmers (Pomona, SOIC8 clips) where contact pressure varies
> and pins may not seat fully on all pads simultaneously
> - Budget CH341A/CH347 adapters with cheap ZIF sockets.
> - Long or unshielded SPI wiring picking up noise
>
> in these situations the programmer reports success, the read completes
> without error, but individual bytes or ranges are silently wrong due to
> marginal signal integrity. The only current mitigation is to read multiple
> times manually and compare with sha256sum.
>
> --verify-reads[=<count>] reads the flash count times (default: 3, min: 2)
> and compares consecutive reads byte-by-byte. On mismatch it reports the
> offset and the two differing read numbers.
>

Note that flashrom already has a `-v` / `--verify` command, which compares
the contents of a flash chip with the provided file. In my experience I've
found it to be good enough in most cases. After all, my read integrity
problems have mostly been about reading a chip and verifying that the read
matches the chip's contents, but turns out that the read data is nonsense
(e.g. all FFs). So these days I check if the dump I've just taken looks
right; e.g. after reading a mainboard's flash chip (where UEFI is stored),
I check that UEFITool can open it.


> Consecutive comparison is used deliberately rather than comparing all
> reads against read first read.
>
> A patch is ready. Happy to Gerrit it if the approach looks reasonable, or
> adjust based on feedback.
>

Please don't hesitate and simply put it up on Gerrit. The point of Gerrit
is to review and discuss patches, after all! :-)


> Abdelkader Boudih
> _______________________________________________
> flashrom mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
>

Best regards,
Angel
_______________________________________________
flashrom mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to