spi-flashrom

glasgow run spi-flashrom

Expose SPI via a socket using the flashrom serprog protocol; see https://flashrom.org.

This applet has the same default pin assignment as the memory-25q applet; see its description for details.

Usage:

glasgow run spi-flashrom -V 3.3 --freq 4000 tcp::2222
/sbin/flashrom -p serprog:ip=localhost:2222

It is also possible to flash 25-series flash chips using the memory-25q applet, which does not require a third-party tool. The advantage of using the spi-flashrom applet is that flashrom offers compatibility with a wider variety of devices, some of which may not be supported by the memory-25q applet.

usage: glasgow run spi-flashrom [-h] [-V VOLTS] [--cs PIN] [--sck PIN]
                                [--copi PIN] [--cipo PIN] [--wp PIN]
                                [--hold PIN] [-f FREQ]
                                ENDPOINT
endpoint

listen at ENDPOINT, either unix:PATH or tcp:HOST:PORT

-h, --help

show this help message and exit

-V <volts>, --voltage <volts>

flash chip power (range: 1.8..5 V, or ‘S<port>’ to follow the voltage sensed on a port; default: unchanged)

--cs <pin>

bind chip select to PIN (default: ‘A5’, required)

--sck <pin>

bind serial clock to PIN (default: ‘A1’, required)

--copi <pin>

bind controller out, peripheral in to PIN (default: ‘A2’, required)

--cipo <pin>

bind controller in, peripheral out to PIN (default: ‘A4’, required)

--wp <pin>

bind write protect (active low), pulled inactive to PIN (default: ‘A3’, optional)

--hold <pin>

bind hold (active low), pulled inactive to PIN (default: ‘A0’, optional)

-f <freq>, --frequency <freq>

set SCK frequency to FREQ kHz (default: 100)