Comprehensive Guide to Reading BIOS from ASUS ROG Strix B350-F Motherboard Using Flashrom 1.3 on Ubuntu 22.04
Reading the BIOS from your ASUS ROG Strix B350-F motherboard equipped with the MXIC MX25U12873F BIOS chip requires a systematic approach to ensure success and prevent potential hardware issues. This guide provides an in-depth, step-by-step procedure to achieve this using Flashrom version 1.3 on Ubuntu 22.04.
1. Compatibility Check
Before proceeding, it is crucial to verify the compatibility of your hardware and software components to ensure a smooth BIOS reading process.
1.1. Flashrom Version
Ensure that you are using Flashrom version 1.3 or later. This version supports a wide range of motherboards and BIOS chips, including the MXIC MX25U12873F.
1.2. Chipset Support
Your ASUS ROG Strix B350-F motherboard utilizes the AMD B350 chipset. Flashrom supports AMD chipsets, but it is essential to confirm that the SPI (Serial Peripheral Interface) flash chip is accessible and not locked by the motherboard’s firmware.
1.3. BIOS Chip Compatibility
The BIOS chip, MXIC MX25U12873F, is a 128Mb (16MB) SPI flash chip supported by Flashrom. Verify its compatibility by consulting the Flashrom Supported Hardware List.
2. Setup Requirements
Proper setup is vital for successfully reading the BIOS. The following components and software must be prepared.
2.1. Hardware Requirements
- A computer running Ubuntu 22.04 with administrative privileges.
- A compatible SPI programmer, such as the CH341A, Bus Pirate, or similar devices supported by Flashrom.
- A stable power supply to the motherboard if utilizing the internal SPI interface.
- An SOIC8 clip or similar adapter for in-circuit reading, if applicable.
2.2. Software Installation
Install Flashrom and its dependencies by executing the following commands in the terminal:
sudo apt update
sudo apt install flashrom
Verify the installation and version:
flashrom --version
Ensure that the output confirms Flashrom version 1.3 or later.
2.3. Permissions
Flashrom requires root privileges to access hardware interfaces. Always execute Flashrom commands with sudo:
sudo -i
3. Connecting the Programmer
Proper connection of the SPI programmer to the BIOS chip is essential to prevent hardware damage and ensure accurate reading of the BIOS data.
3.1. In-Circuit Reading
- Use an SOIC8 clip to connect the SPI programmer to the MX25U12873F BIOS chip on the motherboard.
- Ensure correct alignment by matching pin 1 on the clip to pin 1 on the BIOS chip, typically indicated by a dot or notch.
- Secure the connection to prevent any movement during the reading process.
3.2. External Programmer Setup
- If the internal SPI interface is inaccessible or locked, use an external SPI programmer like the CH341A.
- Connect the programmer to your computer via USB and ensure it is recognized by the system.
- Attach the SOIC8 clip to the BIOS chip, ensuring accurate pin alignment.
4. Identifying the Chipset Option in Flashrom
To read the BIOS, you must specify the correct programmer option in Flashrom. For the ASUS ROG Strix B350-F motherboard with the MXIC MX25U12873F chip, the primary programmer options are:
4.1. Internal Programmer
If the SPI interface is accessible and not locked by the motherboard’s firmware, you can use the internal programmer option:
sudo flashrom -p internal
This command instructs Flashrom to use the motherboard's internal SPI interface to communicate with the BIOS chip.
4.2. External Programmer (CH341A)
If the internal SPI interface is unavailable, utilize an external SPI programmer such as CH341A:
sudo flashrom -p ch341a_spi
This option directs Flashrom to communicate with the BIOS chip via the CH341A external programmer.
Recommendation: Attempt using the internal programmer first. If the chip is not detected or the interface is locked, proceed with using an external programmer like CH341A.
5. Reading the BIOS
Once the programmer is correctly connected and the chipset option is identified, proceed with reading the BIOS.
5.1. Detecting the BIOS Chip
Run Flashrom to detect the connected programmer and BIOS chip:
sudo flashrom -p <programmer>
Replace <programmer> with either internal or ch341a_spi based on your setup.
Expected Output:
Flashrom v1.3 (https://www.flashrom.org)
...
Found MXIC MX25U12873F (16 Mbit)
...
This output confirms that Flashrom has successfully detected the BIOS chip.
5.2. Reading the BIOS Content
Execute the following command to read the BIOS and save it to a file:
sudo flashrom -p <programmer> -r bios_backup.bin
Example using internal programmer:
sudo flashrom -p internal -r bios_backup.bin
This command reads the BIOS data and stores it in a file named bios_backup.bin in the current directory.
6. Verifying the Read Operation
To ensure the BIOS has been read correctly, perform a verification step.
6.1. Verify BIOS Backup
Run Flashrom with the verify option:
sudo flashrom -p <programmer> -v bios_backup.bin
Example using internal programmer:
sudo flashrom -p internal -v bios_backup.bin
Successful verification indicates that the BIOS has been accurately read and the backup file matches the chip's contents.
6.2. Inspecting the Backup File
Ensure the backup file size corresponds to the BIOS chip's capacity (typically 16MB for MX25U12873F):
ls -lh bios_backup.bin
The output should reflect a file size close to 16MB.
Optionally, use tools like binwalk to analyze the BIOS image:
sudo apt install binwalk
binwalk bios_backup.bin
This analysis can provide insights into the BIOS structure and confirm the integrity of the backup.
7. Troubleshooting
Encountering issues during the BIOS reading process is not uncommon. The following troubleshooting steps address common problems.
7.1. Chip Not Detected
- Verify Connections: Ensure that the SPI programmer is securely connected to the BIOS chip. Reattach the SOIC8 clip if necessary.
- Check Programmer Compatibility: Confirm that your programmer supports the MX25U12873F chip and operates at the correct voltage (1.8V for MX25U12873F).
- Force Detection: Use Flashrom's board enable code to force detection:
sudo flashrom -p <programmer>:boardenable=force
7.2. Verification Fails
- Reattempt Reading: Retry the read operation to rule out transient errors.
- Inspect Backup File: Ensure the backup file size and contents are as expected.
- Check for Interference: Disconnect other peripherals or devices that might interfere with the SPI communication.
7.3. Programmer Issues
- Update Flashrom: Ensure you are using the latest version of Flashrom that supports your programmer and BIOS chip.
- Consult Documentation: Refer to the Flashrom Documentation for specific instructions related to your programmer.
7.4. Permission Errors
- Run as Root: Always execute Flashrom commands with
sudoto grant necessary permissions. - Check User Groups: Ensure your user is part of groups that have access to USB devices, if applicable.
8. Additional Notes
-
Backup Precautions: Always create a backup of your BIOS before attempting any modifications. This backup serves as a fail-safe in case of errors during the reading or writing process.
-
Write Operations: Avoid writing to the BIOS chip unless absolutely necessary. Incorrect writes can brick the motherboard.
-
Voltage Considerations: The MX25U12873F operates at 1.8V. Ensure your programmer supports this voltage or use a level shifter to match voltage requirements.
-
External Programmers: If the internal SPI interface is inaccessible, external programmers like the CH341A are reliable alternatives. Use appropriate adapters and ensure correct pin alignment.
-
System Stability: Perform the BIOS reading process on a stable system to prevent interruptions that could corrupt the backup file.
- official Flashrom documentation
9. Example Commands
Below is a summary of key commands used in the BIOS reading process:
9.1. Install Flashrom
sudo apt update
sudo apt install flashrom
9.2. Verify Flashrom Installation
flashrom --version
9.3. Detect BIOS Chip
sudo flashrom -p internal
Or, using external programmer:
sudo flashrom -p ch341a_spi
9.4. Read the BIOS
sudo flashrom -p internal -r bios_backup.bin
Or, using external programmer:
sudo flashrom -p ch341a_spi -r bios_backup.bin
9.5. Verify the BIOS Backup
sudo flashrom -p internal -v bios_backup.bin
Or, using external programmer:
sudo flashrom -p ch341a_spi -v bios_backup.bin
9.6. Inspecting the BIOS Backup with Binwalk
sudo apt install binwalk
binwalk bios_backup.bin
10. Safety Precautions
- Power Stability: Ensure that the motherboard is powered off and disconnected from any power source before connecting or disconnecting the SPI programmer.
- Static Electricity: Use anti-static precautions, such as grounding yourself, to prevent electrostatic discharge (ESD) damage to the motherboard and BIOS chip.
- Data Integrity: Avoid interruptions during the BIOS reading process to maintain data integrity.
- Professional Assistance: If you are unfamiliar with BIOS flashing or hardware manipulation, seek professional assistance to prevent hardware damage.
11. Conclusion
Successfully reading the BIOS from your ASUS ROG Strix B350-F motherboard using Flashrom 1.3 on Ubuntu 22.04 involves careful preparation, correct hardware setup, and precise execution of commands. By following this comprehensive guide, you can safely and effectively back up your BIOS, safeguarding against potential firmware issues and ensuring system stability.
Disclaimer: Manipulating BIOS firmware carries inherent risks, including the potential to render your motherboard inoperable. Proceed with caution and ensure you understand each step before execution. Always maintain a reliable backup to recover from unintended consequences.
Last updated December 28, 2024