Flash EEPROM programmer


19 posts
by carldani » Wed Jan 11, 2012 12:37 am
Given the abundance of GPIOs at 3.3V, using the Raspberry Pi as programmer for Flash EEPROMs (commonly used as BIOS chips) would be awesome.

Pretty much all flash chips (Parallel/FWH/LPC/SPI interfaces) nowadays use 3.3V, so you'd just need a Raspberry Pi to recover from a failed BIOS/EFI/PXE/firmware/whatever update or to write a new image to such a flash chip. (Please note that I'm not talking about flash chips used in SSDs or USB pen drives, those are way more complicated to work with.)

The open source flashrom tool at http://flashrom.org/ is a perfect match for this task. It can use GPIO interfaces to bitbang a SPI bus/interface, or if you already have a Linux SPI driver in your kernel, it can use that driver. That alone would handle almost all flash chips on very recent x86 mainboards. Support for older LPC/FWH/Parallel type flash chips is available as well, but the bitbanging variants of those buses are fairly experimental.

If anyone with access to a beta board is willing to test how well flashrom works, I will help you to get it running and to test it.

Disclaimer: I'm the maintainer of flashrom, and I have written flashrom drivers for various pieces of hardware in the past (Bus Pirate etc.). I don't have any commercial interest in flashrom, it is a hobby for me.
Posts: 15
Joined: Wed Jan 11, 2012 12:08 am
by carldani » Wed Jan 11, 2012 10:35 pm
So... anyone with a beta board who is willing to give this a try?

The easiest way to test would be to rip a SPI flash chip (usually 8 pins, model number is something25something) out of a dead mainboard or a dead graphics card or a dead network card, tell me the flash chip model number and the GPIO pins you plan to attach it to, and I'll write a driver for it. If you don't know how to wire it up, just tell me the model number and I'll guide you. Compiling the flashrom source code is easy, you just download it and type "make".
Posts: 15
Joined: Wed Jan 11, 2012 12:08 am
by franta » Mon Jun 11, 2012 10:12 am
If you are still looking for some testers, I'd like to test it ... last week I have received my RasPI and one of my friends recently killed his MB when he was flashing BIOS.
Posts: 4
Joined: Mon Jun 11, 2012 10:09 am
Location: Czech Republic
by carldani » Wed Jun 13, 2012 8:09 pm
Nice, finally someone who can test!

Which flash chip is on that mainboard? If it is a SPI flash chip, you could just use the in-kernel SPI driver (if your kernel is new enough and has that driver merged):
Code: Select all
flashrom -p linux_spi:dev=/dev/spidevX.Y

Debian testing/unstable has a flashrom which should be new enough, but it's easy to compile flashrom from source: http://www.flashrom.org/Downloads has a short howto for compiling flashrom.
If you need any help, drop by in #flashrom on irc.freenode.net.
Posts: 15
Joined: Wed Jan 11, 2012 12:08 am
by carldani » Wed Jun 13, 2012 8:39 pm
Oh, and you need Linux kernel 3.2 from http://www.bootc.net/projects/raspberry-pi-kernel/ which has the SPI driver needed by flashrom.
Posts: 15
Joined: Wed Jan 11, 2012 12:08 am
by franta » Wed Jun 13, 2012 9:36 pm
It uses SST25VF080B ... from the datasheet it seems that it has SPI ... unfortunatelly it's already a little late today to pick up soldering iron and have some fun ... also my hands are a little shaky for soldering SMDs today (I will probably have to lower my caffeine intake :lol: )

Anyway, thanks for the info, I'll update this thread when I get to it (hopefully on Sunday).
Posts: 4
Joined: Mon Jun 11, 2012 10:09 am
Location: Czech Republic
by franta » Sun Jun 17, 2012 10:07 pm
SUCCESS!!! :)
It worked great! I have used the kernel you have suggested and debian wheezy... flashrom wasn't in the repository, but it was no problem to compile version 0.9.5.2 ... I only had to install libpci-dev :)

If you want I have some ugly photos of the my setup ... the chip was SMD and I have soldered wires directly to MB ... ;)

I have tried reading, writing and verifying the flash with RasPi's SPI and everything worked.

I have connected only VDD, VSS, SI, SO, SCK and CE# and it worked (I thought that I will have to do some magic with WP# but I was either lucky or it wasn't necessary :))
Posts: 4
Joined: Mon Jun 11, 2012 10:09 am
Location: Czech Republic
by carldani » Sun Jun 17, 2012 11:34 pm
Excellent, glad to hear it worked.
How long did it take to reflash the chip?
Posts: 15
Joined: Wed Jan 11, 2012 12:08 am
by franta » Mon Jun 18, 2012 8:56 am
I THINK it was about a minute or two ... I'd say pretty fast ... I didn't think about measuring it :| and you know how fast time runs when you are excited :) But I would say that it didn't take (significantly) longer than the normal flashing with manufacturer supplied utility.
Posts: 4
Joined: Mon Jun 11, 2012 10:09 am
Location: Czech Republic
by vorticerosso » Wed Aug 15, 2012 3:54 pm
Hi,
I'd like to know how to connect the raspberry pi to an SST 49LF020 in order to reprogram it.
If I've understood well, the SST 49LF020 has a parallel interface for writing.
Could someone write me how to connect the RPI GPIO pins to the LPC?
Thanks
Posts: 1
Joined: Wed Aug 15, 2012 3:49 pm
by Jahn » Sat Aug 18, 2012 10:34 am
Yeah, it would be good if Rasberry could work as EEPROM programmer. But has anyone thought about extending it for NAND flash memory programmer so that it can program NAND flash made by Hynix, Elpida, Samsung? E.g.. HY27US08121A or similar is used in Xbox360 and other kind of boxes?
Posts: 2
Joined: Wed Aug 08, 2012 8:28 pm
by jdiego » Wed Jan 23, 2013 11:59 am
Hello,

Is this flashrom tool able to program normal EEPROMs like 24LCxx in buses like SPI, I2C and Microwire ??

It would be really nice to build a U$S35 full programmer.
Posts: 6
Joined: Mon Jan 21, 2013 2:35 am
by Hi-Z » Thu Jan 24, 2013 9:24 pm
jdiego wrote:Is this flashrom tool able to program normal EEPROMs like 24LCxx in buses like SPI, I2C and Microwire ??


For 24xx16 devices and smaller, i2c-tools & smbus are more than adequate.

For 24xx32 and larger, the device addressing goes from 8 bit to 16 bit, of which the above tools may have some issues. eeprog is another program which addresses 16 bit much easier.

There's lots more choices, which are but a search away
Posts: 28
Joined: Wed Jan 02, 2013 8:19 pm
Location: Canuckistan
by jdiego » Sun Jan 27, 2013 10:29 pm
Thank you Hi-Z for the provided information.

Any way, if it doesn't bothers you, I will keep my question open because it wasn't answered, but rewriting:

Does somebody knows if the FLASHROM tool is able to program normal EEPROMs like 24xx,93xx,etc in buses like SPI, I2C and Microwire by itself using whatever kernel module is needed ??

I don't find explicit information on its website regarding this kind of devices.
I know that for example for microwire the spi_gpio driver can be used.

It would be gratefully appreciated.
Posts: 6
Joined: Mon Jan 21, 2013 2:35 am
by JorsMatthys » Mon Feb 18, 2013 2:34 am
Everytime i try to use flashrom I get the following problem:

pcilib: Cannot open /proc/bus/pci
pcilib: Cannot find any working access method.

Does anyone know how to resolve this ?

I might have done something wrong in installing flashrom. I just got the latest version, compiled it and then installed this libpci-dev that is mentioned a few posts up.

Thanks in advance.
Posts: 1
Joined: Mon Feb 18, 2013 2:28 am
by greatdane » Tue Feb 19, 2013 7:47 pm
try running as root or use sudo
Sand Bay, North Somerset, UK
User avatar
Posts: 27
Joined: Mon Apr 30, 2012 7:58 pm
Location: North Somerset, UK
by alerque » Fri Nov 22, 2013 7:33 pm
It works. I was able to reflash my borked EUFI BIOS chip using an rPi, flashrom and some scrounged up parts.
Posts: 1
Joined: Thu Nov 21, 2013 11:33 pm
by cetverooki » Tue Mar 11, 2014 9:46 am
@ carldani

If you are still interested in this please contact me. I;m willing to test LPC / paralel flashing using RPI. I have flashed SPI bios before using flashrom.
Posts: 13
Joined: Tue Mar 11, 2014 9:42 am
by yv1hx » Wed May 21, 2014 7:54 pm
carldani wrote:Given the abundance of GPIOs at 3.3V, using the Raspberry Pi as programmer for Flash EEPROMs (commonly used as BIOS chips) would be awesome.

Pretty much all flash chips (Parallel/FWH/LPC/SPI interfaces) nowadays use 3.3V, so you'd just need a Raspberry Pi to recover from a failed BIOS/EFI/PXE/firmware/whatever update or to write a new image to such a flash chip. (Please note that I'm not talking about flash chips used in SSDs or USB pen drives, those are way more complicated to work with.)

The open source flashrom tool at http://flashrom.org/ is a perfect match for this task. It can use GPIO interfaces to bitbang a SPI bus/interface, or if you already have a Linux SPI driver in your kernel, it can use that driver. That alone would handle almost all flash chips on very recent x86 mainboards. Support for older LPC/FWH/Parallel type flash chips is available as well, but the bitbanging variants of those buses are fairly experimental.

If anyone with access to a beta board is willing to test how well flashrom works, I will help you to get it running and to test it.

Disclaimer: I'm the maintainer of flashrom, and I have written flashrom drivers for various pieces of hardware in the past (Bus Pirate etc.). I don't have any commercial interest in flashrom, it is a hobby for me.


I know this is a old thread, but I would to know if this utility can read/program microwire EEPROMS such as 93C46/56/66 family.
Thanks in advance :D
Marco-Luis
Unemployed Telecom Specialist
http://www.meteoven.org
http://yv1hx.no-ip.org
http://twitter.com/meteoven
Posts: 224
Joined: Sat Jul 21, 2012 10:09 pm
Location: Zulia, Venezuela