Install Libreboot with Arduino Uno on Trisquel Linux.

The author is not responsible for any unwanted consequences.

DISCLAIMER: It seems Arduino Uno SPI output 5v, and I’m doing it a little wrong, It must bee 3.3v to flash and 5v may be dangerous to some chips, but I made it at least two times and all was good and working. For better safety you need something like this logic converter.

All you need to do it :

– Arduino Uno(with other arduino most steps will be the same).

– SOIC16 or SOIC8 clips(POMONA 5252 for example).

– wires to connect Arduno with clip.

Building the software

Frser-duino

To build Frser-duinoyou need following packages:

sudo apt install arduino arduino-core

First get the firmware source:

git clone –recursive git://github.com/urjaman/frser-duino
cd frser-duino

Then build it:

For a board with a 8u2 or a 16u2 (Arduino Uno):

make u2 && make flash-u2

need Arduino Uno connected.

flashrom

You need flashrom and better if you build lattest version.
To build flashrom you need to install the following software:

* pciutils+libpci (if you want support for mainboard or PCI device flashing)
* libusb (if you want FT2232, Dediprog or USB-Blaster support)
* libftdi (if you want FT2232 or USB-Blaster support)

On Trisquel install following packages:

sudo apt install libpci-dev libusb-1.0-0-dev libftdi-dev

Downloading the lattest release of flashrom from their site:

https://www.flashrom.org/Latest_release

Unpack it and type commands:

cd flashrom-0.9.8
make
make install

Connect Pins with Arduino

I have SOIC16 chip but you can search info about pins online or in the datasheet for your flash chip.

SOIC16 pinout (more info available online, or in the datasheet for your flash chip):

HOLD 1-16 SCK
VDD 2-15 MOSI
N/C 3-14 N/C
N/C 4-13 N/C
N/C 5-12 N/C
N/C 6-11 N/C
SS 7-10 GND
MISO 8-9 WP

Be careful about chip orientation in my case chip was rotated by 180 deegrees in motherboard.

CIMG0989

SOIC8 pinout (more info available online, or in the datasheet for your flash chip):

SS 1-8 VDD
MISO 2-7 HOLD
WP 3-6 SCK
GND 4-5 MOSI

The following shows how to connect clip to the Arduino:

Arduino pin 3.3v – VDD
Arduino pin GND – GND
Arduino pin 10 – SS
Arduino pin 11 – MOSI
Arduino pin 12 – MISO
Arduino pin 13 – SCK

The Bios chip used is a MX25L6405D.

The Arduino is an arduino uno.

CIMG0988

Reading BIOS and Writing Libreboot

After all connected, you need to read existed rom by command:

flashrom -p serprog:dev=/dev/ttyACM0:115200 -r uno.rom

if flashrom quest for chip definition(“Please specify which chip definition to use with the -c option.”) – specify it by adding -c .

Save uno.rom for return to proprietary firmware if nedeed.

And after all write libreboot to chip:

flashrom -p serprog:dev=/dev/ttyACM0:115200 -w path/to/libreboot/rom/image.rom -V

From Libreboot Documentation:

You might see errors, but if it says Verifying flash… VERIFIED at the end, then it’s flashed and should boot. If you see errors, try again (and again, and again); the message Chip content is identical to the requested image is also an indication of a successful installation.”

CIMG0987

CIMG0996

Links to additional informational:

Advertisements

10 thoughts on “Install Libreboot with Arduino Uno on Trisquel Linux.

  1. Right question. It seems Arduino Uno SPI output 5v, and I’m doing it wrong, It must bee 3.3v to flash and 5v may be dangerous to some chips. But I made it at least two times and all was good.

    Like

  2. Could you kindly release this guide under a free CC license? Either CC0, CC BY or CC BY-SA, so that it can be reused freely 🙂

    Thanks

    Like

    1. I think it needs to be rewrited a little with using logic converter for 3v output. I do this simply because I don’t have beaglebone black and try to flash libreboot with arduino and it works for me two times, but I have realise that Arduino Uno SPI logic 5v and it may be dangerous for SPI chip. As I see it needs 3v. If you still want you can use it free under CC0.

      Like

  3. what this error?
    serprog: requested mapping AT45CS1282 is incompatible: 0x1080000 bytes at 0x00000000fef80000.
    No EEPROM/flash device found.

    Like

    1. As I search on the internet first line “serprog: requested mapping AT45CS1282 is incompatible: 0x1080000 bytes at 0x00000000fef80000.” may be simply bypassed. But second line “No EEPROM/flash device found.” means it not find SPI chip. It may be for various reasons, maybe something not connected or something else. I don’t know why.

      Like

  4. Hello No0n3,

    I have another question: In the libreboot documentation one is supposed to additionally connect the flash chip to a PSU in order to power it. Apparently the BBB as well as an Arduino alone are not enough to power it (not enough current?). It seems you still managed to do everything with no additional PSU. I don’t see any jumper cables connected to a PSU in your pictures. How did you do that?

    Greetings,

    xyloth62

    Like

      1. To be honest, I don’t know, it just works, maybe not for first try(but for second or third and letters VERIFIED showed on screen) and it works. I didn’t measure amperage by myself. Maybe next time I try to measure amperage.

        Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s