Hardware flashing PureBoot

Overview

It is always good to have multiple options to get yourself out of a jam, and this hardware flashing method for flashing PureBoot is an excellent tool for anyone wanting to tinker with or improve their BIOS. Of course, you can always flash your custom PureBoot using the built-in menu but, with development comes bugs, and flashing via the menu may not be an option if there is an issue with your custom build. Fortunately, you can recover from bugs that prevent the boot firmware from loading on your Librem 14 by hardware flashing the BIOS with a chip flasher.

See also

Required materials

  1. CH341A spi chip programmer (Supplying 3.3v)

  2. SOIC8 clip (Often sold together with the programmer.)

  3. Screwdriver (To open the Librem 14)

  4. Separate PureOS or Debian computer (As your Librem 14 will be offline for the upgrade)

Procedure

  1. Remove any external power.

  2. Unscrew and remove the backplate.

  3. Unplug the battery from the motherboard.

  4. Assemble a CH341a programmer. Attach your chip clip with pin 1 aligned with the red stripe.

  5. Locate your BIOS flash chip U49, between the CPU and the nearest fan.

  6. Locate the depression on the BIOS chip. This indicates the location of pin 1.

  7. Attach the chip clip making sure to align the red stripe again.

  8. Attach to the programmer to a PureOS computer, like a laptop or even Librem 5.

  9. Use the coreboot utility to prepare a firmware image for your device:

mkdir ~/updates
cd ~/updates
wget https://source.puri.sm/firmware/utility/raw/master/coreboot_util.sh
sudo bash coreboot_util.sh
  1. Select “Prepare firmware for manual flash”, then follow the prompts to prepare the firmware image. When complete, the utility will show the name of the prepared firmware file.

  2. From the terminal, install flashrom:

sudo apt install flashrom
  1. If you are flashing from a Librem 5, build flashrom:

sudo apt install git make gcc libusb-1.0-0-dev libudev-dev
git clone https://github.com/flashrom/flashrom.git
cd flashrom/
make
sudo make install
  1. Verify everything is correctly connected:

sudo flashrom -p ch341a_spi
  1. Flashrom may detect two possible chips. If so, add -c <chip> to all the remaining commands, pointing at the first chip found.

  2. To begin the flash, run this command, using the path to the firmware image shown by the utility:

sudo flashrom -p ch341a_spi -w ~/updates/pureboot-librem_14-Release-23.rom -c GD25B128B/GD25Q128B
  1. Make sure to replace GD25B128B/GD25Q128B with your chip ID. This takes several minutes to complete.

  2. After a successful flash, unplug the chip programmer.

  3. Remove the clip from the chip.

  4. Attach the battery and screw the backplate back on.

  5. Boot the Librem 14.