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.

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.

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

Reply via email to