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
was able to flash the p5b mobo using spare pc p/s putting a switch in to start it and appropriate voltages cable colors are red +5v, Orange +3.3v, Yellow +12v and black ground, old usb header that would go in pci slots on back of case.
there are diy pages that give you pinouts and the rest to build your spi bios reprogrammer, used usb with win98 dos, cwsdpmi, and spipgm2, current bios update from Asus, follow guide and save your board
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.
It worked ! I tried it tonight on my P5B bios chip. Worked like a charm. Wouldn’t verify at first but I changed 3.3v to 5v and now the bios chip is flashed. Thanks again for your fantastic work :).
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.
It works with arduino duemillanove with that patch:
diff –git a/serprog.c b/serprog.c
index daf797e..fafe77d 100644
— a/serprog.c
+++ b/serprog.c
@@ -72,7 +72,7 @@
void setup_uart( unsigned long bauds )
{
– int freq = (F_CPU / 4 / bauds -1) /2 ;
+ int freq = ( (F_CPU / (8 * bauds) ) -1) ;
/* Set baud rate */
UBRR0H = (unsigned char)(freq>>8);
UBRR0L = (unsigned char)freq;
@@ -122,7 +122,6 @@ void putchar_uart( unsigned char data )
/* Wait for empty transmit buffer */
loop_until_bit_is_set(UCSR0A, UDRE0);
/* Put data into buffer, sends the data */
– _delay_us(10); //8us mostly stable, 10us to be sure
UDR0 = data;
}
:D Gave up couple of weeks ago , will try it again today !!!
Hi there i recently tried to update myJH. now ive read that i can order a replacement BIOS but before that i want to explore my chances now i have a ARDUINO UNO and i have desoldered the chip, it is a W25Q32 SOIC 8-PIN which can be ordered from this site: http://www.ebay.co.uk/itm/BIOS-CHIP-ASUS-G71G-G71Gx-G71V-N50Vc-N50Vn-G73JH-G73JW-/170533190039?pt=UK_Motherboards_CPUs&hash=item27b491f997&clk_rvr_id=392429124620&afsrc=1#ht_1028wt_699
now i have the image i want to flash and to flash it with the arduino… but how do i connect the pins and how do i put the image n there? is there a detailed guide i can follow for this? is it even possible for me? thanx for the time.
im sorry for the badly written post, i have a ASUS G73JH with a bricked BIOS, i have desoldered the chip and i want to flash the BIOS in manually with the ARDUINO UNO, how do i do that? thanx for the help again
it’s explained in the flashrom wiki….
( http://www.flashrom.org/Serprog#Arduino_flasher_by_GNUtoo )
Denis
hi gui, ive been trying to erase and write .bin file to my ST Micro/SGS M25P32 using my arduino uno but no luck. i completely newbie, i dont know how to use cmd to run flash rom. i have done the wiring right. can i request you a clear step by step guide on how to erase and write .bin file?? please. thanks a lot
hoping for your replay. thanks
hi, what’s the error you get by following that howto:
http://www.flashrom.org/Serprog#Arduino_flasher_by_GNUtoo
Denis
thank to your reply
i used windows 7 cmd and type cd\
then type (-p serprog:dev=/dev/ttyACM0:2000000 -r coreboot.rom)
then replied (# is not recognized as internal or external command
operable program or batch file)
is windows compatible with flash rom?
could you explain to me your guide like below:
Required software
To make it work you need:
flashrom from svn
serprog-duino which runs on the arduino
The avr toolchain(avr-gcc, avr-libc,make etc…)
Building the software
$ svn co svn://flashrom.org/flashrom/trunk flashrom
$ cd flashrom && make
$ cd ../
$ git clone git://gitorious.org/gnutoo-personal-arduino-projects/serprog-duino.git
$ cd serprog-duino && make && make upload
Running flashrom
./flashrom -p serprog:dev=/dev/ttyACM0:2000000
I think there is some port of flashrom for Microsoft Windows, specially for external programmers, you should try that, but I don’t have Microsoft Windows to test….
you would also need to create a Microsoft Windows specific howto: you would need a toolchain for avr(there is one included with the arduino IDE).
If you are having issues with reliability while flashing, shorten the cables from the arduino to the flash chip. I was using 1Ft cables and sometimes flashrom would see the chip, sometimes not. When the chip was recognized, the erase would fail. I shortened the cables to under 10in and it worked flawlessly. Only took me 3 days to figure out!
Hi. I know this a very old post. Im trying to fhash a BIOS chip (winbond w25Q64FV) with an arduino nano. I’m first reading/dumping the information inside the chip for backup, but it is taking a long time, and I don’t even know if it is working, because only says: “Reading flash ….” but no file has been created yet. It’s been running for about 1 hour now.
Is this normal. How long does it takes to read the full content of the chip. It’s 8KBytes.
I am using:
Arduino nano with frser-duino
flashroom
Thanks in advance.
UPDATE:
It appears that the chip has some bad sectors. I have done some tests reading small chunks of the flash. Some of these readings finish ok inmediatly, while other hungs indefinitelly.
Is there anyway of forcing the read/write of flash even if some sectors are bad ?
Kind regards