hydrafw: HydraBus hangs when using flashrom (fixed)

HydraBus is supposed to be binary compatible with the Bus Pirate, so flashrom should work out of the box (flashrom has a bus pirate mode).

However, when trying to ID a chip using flashrom (the most basic operation before a read or write), flashrom just hangs:

tools > sudo flashrom -p buspirate_spi:dev=/dev/ttyACM0,spispeed=8M
flashrom v0.9.9-r1954 on Linux 4.4.76-grsec+ (x86_64)
flashrom is free software, get the source code at https://flashrom.org

Calibrating delay loop... OK.
<HANGS FOREVER>

Issue requested by “Balda” in IRC.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Since the PR (https://github.com/flashrom/flashrom/pull/21) is open for nearly three years now, I took some time to reimplement the Serprog protocol in HydraFW.

This works on any recent flashrom :

$ flashrom -V --programmer serprog:dev=/dev/hydrabus
flashrom v1.2 on Linux 5.8.3-arch1-1 (x86_64)
flashrom is free software, get the source code at https://flashrom.org

flashrom was built with libpci 3.6.4, GCC 9.3.0, little endian
Command line (3 args): flashrom -V --programmer serprog:dev=/dev/hydrabus
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Initializing serprog programmer
No baudrate specified, using the hardware's defaults.
serprog: connected - attempting to synchronize
..
serprog: Synchronized
serprog: Interface version ok.
serprog: Bus support: parallel=off, LPC=off, FWH=off, SPI=on
serprog: Maximum write-n length is 4096
serprog: Maximum read-n length is 4096
serprog: Programmer name is "Hydrabus"
serprog: Serial buffer size is 16
serprog: Output drivers enabled
The following protocols are supported: SPI.
[...]

Hello @afiskon !

I found a bug in my flashrom patch. It should be fixed now. Can you please test again ?

> ./flashrom -p buspirate_spi:dev=/dev/ttyACM0 --read flash.dump                                [staging]
flashrom p1.0-26-g524bbe3-dirty on Linux 4.17.11-arch1 (x86_64)
flashrom is free software, get the source code at https://flashrom.org

Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Found GigaDevice flash chip "GD25Q32(B)" (4096 kB, SPI) on buspirate_spi.
Reading flash... done.

@afiskon Great news !

FYI, I ported the patch to the current flashrom revision here : https://github.com/Baldanos/flashrom/tree/master

I hope the PR will get merged soon.