** Mini-Guide for Flashing SPI ROM Chips using Raspberry Pi 3B or 4 **
Please do
not quote the entire mini-guide. Post a link instead.

Most CH341A Programmers output a potentially dangerous
5V on the SPI (Serial Peripheral Interface) I/O pins (MOSI, MISO, SCLK). While some users have been successful with these low-cost programmers,
more reliable alternatives are the Raspberry Pi Models 3B and 4. These devices contain 40 GPIO pins (General Purpose I/O) where certain pins are reserved for specialized functions including communicating with SPI devices. This allows the Raspberry Pi to function as an effective SPI Flash ROM reader/writer. Moreover, the SPI I/O pins are all biased at 3.3V and can accommodate chips such as Winbond W25Q80DV that operate at a voltage between 2.7V and 3.6V.
Disclaimer:
- The procedure described here can brick / damage the device being modified.
- You assume all risk and liability for carrying out any of the steps listed here.
- You further understand that the steps listed here may or may not be accurate or applicable to your particular components.
Step 1: Parts Needed
- Raspberry Pi kit with SD Card, heat sinks, power supply, and HDMI cable. Most Raspberry Pi kits contain all of these items.
- Jumper wires such as this pack consisting of M/M, M/F, and F/F.
- SOIC8 clip such as:
- Update 7-Apr-2020:
- For the Designare Z390, Z390 Aorus Xtreme, and other boards using a Winbond W25Q80DV, I now recommend the low-cost clip because it provides a better grip on these boards.

Step 2: Procedure for Installing / Configuring Raspberry Pi
- Most Raspberry Pi kits come with a Micro SD Card and SD Card adapter. On the Mac, download Raspbian Buster with desktop and recommended software from here.
- Download and install Balena Etcher on the Mac.
- Insert Micro SD Card into the Mac (via the USB SD Card adapter) and burn the Raspbian Buster image to the Micro SD Card with Balena Etcher. When it's done, the Micro SD Card will have Linux ext4 file format, which is unrecognized on Mac. So just pull the card out.
- Remove Micro SD Card from the adapter and insert into Raspberry Pi and boot. Everything is already set up in the Micro SD Card for truly painless installation.
- Click the top left "Raspberry" icon, and select Raspberry Pi Configuration as shown:

- Then select the Interfaces tab and click Enabled next to SPI (Serial Peripheral Interface) as shown:

- Reboot.
- Now you're ready to proceed.
However,
turn off the Raspberry Pi:
- When connecting wires to the GPIO pins.
- When connecting SOIC8 Clip to the GC-Titan Ridge.
Step 3: Connect Pins from Raspberry Pi to SOIC8 Clip.
- Turn OFF the Raspberry Pi and attach wires between Raspberry Pi and SOIC8 Clip as listed below and shown in the diagram.
- May 2020 Update: The Supplemental Procedure is highly recommended. If you follow that procedure then it is not necessary to split the wire from Pin 17 into a "Y". Instead, follow the pin diagram below, but connect the first 3V3 Power pin (Pin 1 on Pi) to Pin 7 on the SOIC clip and connect the second 3V3 Power pin (Pin 17 on Pi) to Pin 3 on the SOIC clip.
Step 4: Connect SOIC8 Clip to SPI Flash ROM
- With Raspberry Pi turned off, gently connect the SOIC8 clip to the Flash ROM device.
- If you're flashing the GC-Titan Ridge, connect the SOIC8 clip to the Winbond chip with the blue dot only. Do not modify the chip with the green dot.
- Always squeeze and unsqueezed the spring-loaded SOIC8 clip gently. You do not want to scrape, dent, or damage the pins of the SPI Flash ROM.
- Now power on the Raspberry Pi.
Step 5: Use
flashrom to read and create backup of the original contents of the SPI Flash chip.
- Lauch the Linux Terminal and use the commands below.
- First we read the existing contents of the SPI Flash ROM and save it. It is critical to make this backup!
- We read the contents three times and compare their checksums to ensure that all three files are identical. This ensures that the chip was read successfully.
- The syntax for the read function is as follows (the spispeed parameter is essential):
sudo flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=1024 -r test1.bin
Code:
pi@raspberrypi:~/Documents $ sudo flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=1024 -r Backup1.bin
flashrom on Linux 4.19.97-v7l+ (armv7l)
flashrom is free software, get the source code at https://flashrom.org
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Found Winbond flash chip "W25Q80.V" (1024 kB, SPI) on linux_spi.
Reading flash... done.
Code:
pi@raspberrypi:~/Documents $ sudo flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=1024 -r Backup2.bin
flashrom on Linux 4.19.97-v7l+ (armv7l)
flashrom is free software, get the source code at https://flashrom.org
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Found Winbond flash chip "W25Q80.V" (1024 kB, SPI) on linux_spi.
Reading flash... done.
Code:
pi@raspberrypi:~/Documents $ sudo flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=1024 -r Backup3.bin
flashrom on Linux 4.19.97-v7l+ (armv7l)
flashrom is free software, get the source code at https://flashrom.org
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Found Winbond flash chip "W25Q80.V" (1024 kB, SPI) on linux_spi.
Reading flash... done.
Code:
pi@raspberrypi:~/Documents $ shasum Backup1.bin Backup2.bin Backup3.bin
3c1e2555a8203a0dc20b7cfe2577636112a82367 Backup1.bin
3c1e2555a8203a0dc20b7cfe2577636112a82367 Backup2.bin
3c1e2555a8203a0dc20b7cfe2577636112a82367 Backup3.bin
- Because all three checksums are identical, the chip was read successfully.
Step 6: Program the Modified Firmware into SPI Flash ROM
- Finally we are ready to program the chip with the modified firmware.
- Locate the firmware file and use the following command:
sudo flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=1024 -w Name_Of_Modified_Firmware.bin
Code:
pi@raspberrypi:~/Downloads $ sudo flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=1024 -w TitanRidgeMacOSFirmware.bin
flashrom on Linux 4.19.97-v7l+ (armv7l)
flashrom is free software, get the source code at https://flashrom.org
Using clock_gettime for delay loops (clk_id: 1, resolution: 1ns).
Found Winbond flash chip "W25Q80.V" (1024 kB, SPI) on linux_spi.
Reading old flash chip contents... done.
Erasing and writing flash chip... Erase/write done.
Verifying flash... VERIFIED.
- If all goes well, your output should resemble the output above, namely:
- Reading old flash chip... Erase/write done.
- Verifying flash... VERIFIED.