dediprog: Implement id reading for SF600 and later
For the SF600, we simply use the more canonical read EEPROM command.
Newer devices use a special command that allows to read the id over
the bulk endpoint. The exact meaning of the magic command bytes is
unknown at this time.
Reading from the bulk endpoint times out on about every other attempt
to fetch the id, unless it's queried twice in a row. `dpcmd' comments
that this is necessary. And traces also show that the Windows applica-
tion runs it twice too (even if not in a row). Tests have shown that
a working read takes up to 5ms. So we lose 10ms tops, which seems ok.
Another observation when only querying the id once (or only repeating
the read when it failed) is that the bulk-in endpoint only keeps wor-
king during the current flashprog run. Future runs fail unless the id
is queried again.
Tested with "SF600PG2. V:01.01.012 HW:01.00", "SF100 V:5.1.9".
Change-Id: I8056d936d41a24824c089e80d6dfed23ad5e0d1c
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/103
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
1 file changed