Recommended resources
The freely available resources this lesson will direct you to.
- Bad Bios Flash - Rescued by a Raspberry Pi? Fixing my AM2+ Board with FlashRomwww.youtube.com
- Recover Bricked BIOS using FlashRom on a Raspberry Piwww.youtube.com
- Corebooting the ThinkPad X230 with Skulls - Famicoman.comfamicoman.com
- How to install coreboot on a Lenovo x230 - stafwag Blogstafwag.github.io
Hello! Welcome back to our "Hardware Surgery" module.
In the last lesson, you meticulously assembled your flashing apparatus, preparing the Raspberry Pi and wiring the SOIC8 clip. The bridge between your control system (the Pi) and the target (the BIOS chip) is built. Today, we connect that bridge and test its integrity. This is the moment of truth for your hardware setup.
Introduction
This lesson focuses on using the flashrom utility to establish and verify a live connection to your x230's BIOS chip. You will physically attach the SOIC8 clip to the motherboard and run a series of commands to confirm that the Pi can correctly identify and communicate with the chip. Think of this as an electronic handshake to ensure everything is working before we proceed with more critical operations.
This lesson directly addresses the learning outcome: Use the 'flashrom' utility to test the connection to the BIOS chip.
- Estimated time to complete: 60 minutes.
- Brief recap: You have already enabled the SPI interface on your Raspberry Pi and connected the jumper wires from the SOIC8 clip to the correct GPIO pins. The flashing tool is assembled and ready.
1. The flashrom Utility: Your Digital Probe (10 minutes)
Before we connect anything, let's get acquainted with our primary software tool. flashrom is a powerful open-source utility that understands how to speak the SPI protocol we discussed previously. It can identify, read, write, erase, and verify a vast array of firmware chips.
Given your background in systems design, you can think of flashrom as the application layer protocol that runs over the SPI physical and data link layers you've just built.
The basic command structure is:flashrom -p <programmer> [options]
- The
-pflag specifies the "programmer" device we are using. For our setup, this will be:
linux_spi:dev=/dev/spidev0.0
This tellsflashromto use the Linux kernel's SPI device driver, which you enabled in the last lesson. - A crucial option for initial testing is
spispeed=<kilohertz>. This allows us to control the speed of the SPI clock. Starting with a low speed (e.g.,512kHz) makes the connection more robust and tolerant of minor signal integrity issues, which can arise from long wires.
For a quick overview of flashrom and its basic commands, you can watch this segment.
2. The Physical Connection: Attaching the Clip (15 minutes)
This part requires a steady hand and careful attention to detail. A poor physical connection is the most common point of failure.
Activity (15 minutes):
-
Power the Chip: As we established, we will not power the chip from the Pi. Ensure the x230's battery is removed. Plug the laptop's AC adapter into the wall and into the laptop's charging port. This provides a stable 3.3V standby current to the motherboard and the BIOS chips, which is exactly what we need. The guide we're using also suggests plugging in a network cable, which can help ensure the standby power circuit is active.
-
Identify the Target Chip: Your x230 has two BIOS chips. We will start by connecting to the bottom chip, which is the larger 8MB chip.
-
Orient and Attach the Clip:
- Look closely at the BIOS chip on the motherboard. You will see a small circular indentation or dot in one corner. This marks Pin 1.
- Identify Pin 1 on your SOIC8 clip's ribbon cable. It is almost always indicated by a red stripe on the edge of the cable.
- Carefully open the jaws of the clip, align the red-striped side (Pin 1) with the dot on the chip (Pin 1), and clamp it down firmly. Ensure it is seated squarely and making good contact with all 8 pins.
How to install coreboot on a Lenovo x230 - stafwag Blog (Wiring)
3. The Electronic Handshake: Running the Test (20 minutes)
With the hardware connected, it's time to see if we can establish communication.
Activity (20 minutes):
Log into your Raspberry Pi via SSH. We will now execute our first flashrom command.
-
Initial Probe:
Run the following command in your Pi's terminal. We start with a lowspispeedto maximize our chances of a successful first connection.flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=512 -
Interpreting the Output:
If the connection is successful, you will see output similar to this:The key part is:
Found Macronix flash chip ...Multiple flash chip definitions match the detected chip(s): ...This is excellent news! It means the chip responded with its JEDEC ID, and
flashromfound that ID in its database. The "Multiple flash chip" message is not an error; it simply means several chip models share the same ID, andflashromwants you to clarify which one it is.For a visual of what a successful detection looks like, see this short clip:
-
Confirming the Chip Model:
Thestafwagblog and other sources confirm the 8MB bottom chip on the x230 is theMX25L6406E/MX25L6408E. Let's run the command again, this time specifying the exact chip with the-cflag.flashrom -p linux_spi:dev=/dev/spidev0.0,spispeed=512 -c "MX25L6406E/MX25L6408E"If this command runs and exits cleanly with the message
No operations were specified, you have definitively confirmed a working, stable connection. Congratulations!
4. When Things Go Wrong: Troubleshooting (10 minutes)
It's very common for the first attempt to fail. The most likely error you'll see is No EEPROM/flash device found. Do not be discouraged; this is a standard part of the process.
Here are the most common causes, in order of likelihood:
- Bad Clip Connection: The clip is not seated properly, is slightly skewed, or has dust/debris preventing contact.
- Fix: Power down the Pi, unclip, and re-clip it carefully. Give it a gentle wiggle to ensure it's snug.
- Incorrect Wiring: One of the jumper wires is on the wrong GPIO pin.
- Fix: Power down the Pi and meticulously re-check your wiring against the diagram from the previous lesson.
- Power Issue: The laptop's AC adapter is not plugged in, or the standby power is not active.
- Fix: Ensure the adapter is plugged in and the charging light on the laptop is on.
- Signal Integrity Issues: This is a more advanced problem. The long jumper wires can act as antennas, and other components on the motherboard can interfere with the high-frequency SPI signals. This is precisely why we start with a low
spispeed. If you get a connection at512but not at higher speeds, this is likely the cause. For our purposes, a stable connection at a lower speed is perfectly acceptable.
The following video provides an excellent case study in troubleshooting a failed flashrom connection. The presenter methodically works through the problem, eventually using an oscilloscope to diagnose the signal integrity issue. While you don't need an oscilloscope, watching this will give you a much deeper appreciation for the electronic principles at play.
Conclusion
You have successfully navigated a critical and often tricky step in the hardware modification process. By physically connecting to the BIOS chip and using flashrom to elicit a response, you have validated your entire flashing apparatus, from the software configuration on the Pi to the last pin on the SOIC8 clip.
Key Takeaways:
flashromis the command-line tool used to interface with firmware chips via a programmer like the Raspberry Pi.- A successful test involves
flashromdetecting the chip and its model. A message likeNo EEPROM/flash device foundindicates a problem, usually with the physical connection. - Starting with a low
spispeedincreases the reliability of the initial connection test. - Troubleshooting is a normal part of the process and almost always comes down to checking the physical connection, wiring, and power supply.
Next Lesson
Your communication link to the firmware is now open and verified. Before we dare to write any new data, we must perform the most crucial safety step: creating a secure backup of the original factory firmware. In the next lesson, "Create and verify multiple redundant backups of the original proprietary BIOS firmware," you will use your now-tested flashrom connection to read the entire contents of both BIOS chips and verify that the backups are perfect, bit-for-bit copies.