[flashrom] Fix for serprog-ardu initialization failure due to unimplemented S_CMD_S_BUSTYPE (0x12)
alexander.meyer at spot-media.de
Wed Aug 15 02:10:39 CEST 2012
I had problems making flashrom talk to an Arduino as described in
It always failed right after this:
Warning: Automatic command availability check failed for cmd 0x12 -
won't execute cmd
With help from stefanct on the IRC I was able to fix it and
successfully write and verify a W25X80 bios chip.
The problem was, stefanct implemented a mandatory check for
S_CMD_S_BUSTYPE (0x12) in flashrom which isn't yet implemented in the
To work around it you can downgrade flashrom to before r1557 or you
can make the Arduino code give a satisfactory answer to the check.
To do that, you must append "| (1 << (S_CMD_S_BUSTYPE - 16))" to the
SUPPORTED_COMMANDS_HIGH define, and send an ACK when asked for
S_CMD_S_BUSTYPE (0x12) in the Arduino code.
Actually, "<stefanct> the right way would be to test if flashrom tries
to set SPI and ack in that case and nak in all other cases".
I also had problems with the high baudrate. Setting it to 1000000
instead of 2000000 seems to work reliably and is still fast enough for
Note that the value must be changed in the arguments for flashrom as
well as the Arduino code.
Thank you guys for your great work and thank you stefanct for helping me out!
More information about the flashrom