We’ve seen the Arduino used to flash BIOS chips several times now. But these hacks are almost always the result of a bad flash. This time around [GNUtoo] is interested in putting a tool in your hands which can be used to flash Coreboot to your motherboard. His offering uses the Arduino Uno, but there are several other hardware options covered as well.
The firmware makes use of the serprog-duino library which was crafted at writing to flash memory chips. On the computer side of things the flashrom package pushes the BIOS image to the Arduino. The nice thing is the flashrom is a common packge in Linux repositories so it’s probably just an apt-get away.
The process isn’t fast, taking about ten minutes to program a 1 Mb chip. But if you’re just interested in loading an open source BIOS alternative this is easy to set up.
hi,
before it took 10 minutes to program a flash chip of 1M, I’ve improved the code and it now takes about 3 minutes.
However I forgot to remove the sentence where I tell that it takes 10 minutes on the wiki before sending the news.
By the way the serprog-duino is not a library but a program made with the help of avr-libc(http://www.nongnu.org/avr-libc/).
I think it also requires a recent version of flashrom(I used the svn version when writing the serprog-duino code).
Thanks for having posted the news.
Denis.
Whats that for a cool knob on the chip?
this is the holder for the bios chip
Thank you.
Do you pronounce his name,
GA-noo-Too
or
Nu-To
?
Kinda sounds like Mewtwo to me.
Can I use this to rescue my P5B Asus motherboard from a failed flash attempt?
is the bios chip socketed, and is it SPI?
if so you should be able to make it work pretty easily.
Denis.
Its not socketed, but it has a special spi header to interact with the bios. I will attach the link to the blogpost I found which mentions flashing the sst with a DIY cable. –>http://bit.ly/4VeIww
Update,
Btw I have the version before the uno , now flashrom gives me a synchronize error. How can I make it work with my Duemilanove?
Hi Tom,
I’ve no duemillanove so I cannot test but I suspect that that part of the serial code should be different.
I’ve a bugduino tough, I’ll test with that.
By the way just to be sure, did you change the Makefile according to your model?
for instance:
-PORT=/dev/ttyACM0
-BAUD=115200
+PORT=/dev/ttyUSB0
+BAUD=57600
Changed the makefile accordinly hex uploads and arduino is ready. Changed the command to ttyUSB0:57600. 🙂 I’m not able to connect the arduino to the spi header yet because I don’t know the pinout.
# flashrom -p serprog:dev=/dev/ttyUSB0:115200
flashrom v0.9.5.2-r1523 on Linux 3.0.0-17-generic-pae (i686), built with libpci 3.1.7, GCC 4.5.2, little endian
flashrom is free software, get the source code at http://www.flashrom.org
Calibrating delay loop… OK.
serprog: Programmer name is “serprog-duino”
Found Winbond flash chip “W25X80” (1024 kB, SPI) on serprog.
No operations were specified.
That is with my bugduino:
* Only the Makefile was changed like before:
-PORT=/dev/ttyACM0
-BAUD=115200
+PORT=/dev/ttyUSB0
+BAUD=57600
* I used 115200, to use another speed you must change the source code. The thing is that on my bugduino only the bootloader speed is at 57600, after the code set the serial port at 115200
I’ll try to think of a way to make the Makefile universal (maybe by using ?=)
Denis.
It worked 🙂 “Calibrating delay loop… OK.
serprog: Programmer name is “serprog-duino”
Found Generic flash chip “unknown SPI chip (RDID)” (0 kB, SPI) on serprog.”
Will connect it to the spi header sometime this week. Post back the results 🙂
Reading the flash chip works , but erasing fails. “serprog_delay used, but the progammer doesn’t support delay” 🙁
Do you have compiled flashrom from svn?
Yes, could it have something to do that I run ubuntu from a VM?
I’m not sure it is or isn’t the VM, but you could try without the VM within a livecd or liveusb.
Denis.
Tried it on livecd , no go :(. Programmer does not support delay. Erase failed.
strange, what is your exact svn revision of flashrom?
Denis.
Interesting, a while ago I had a bad flash on a laptop (the flash is a winbond 25x16avsig spi). I desoldered the bios chip and wired it up to my avr 2560 but never got around to writing the code for it. Perhaps now I don’t have to.
I can’t seem to get it to work on my arduino mega, it’ll connect to flashrom but wont read the chip at all. I changed the #defines so it uses the correct pins and the interrupt. Any idea?
Here’s the #defines I changed.
#define SPI_PORT PORTB
#define SCK PORTB1 /* port 52 */
#define MISO PORTB3 /* port 50 */
#define MOSI PORTB2 /* port 51 */
#define SS PORTB0 /* port 53 */
#define DDR_SPI DDRB
And the interrupt:
ISR(USART0_RX_vect)
{
handle_command(UDR0);
}
I’ve no arduino mega either but someone did a flashrom compatible flasher(also listed on flashrom website) with the arduino mega, altough beware because I think the author forgott to add a license to his code.
Denis.
I wonder if a UNO is necessary, or if I could use a bare ATMega328 or even something like a ATtiny84.
I like the idea of modifying the BIOS of some of my computers, I plan to try this out if I am able to use what I have on hand (I have a dorkboard, I don’t have an official Arduino).
Since I wrote it using the avr-libc, if you adapt the Makefile and maybe the code too to your device, it should work.