chipKIT® Development Platform

Inspired by Arduino™

SPI Flash Programmer

Created Sat, 21 Sep 2013 23:36:23 +0000 by majenko


Sat, 21 Sep 2013 23:36:23 +0000

Well, that was a fun day for me...

Have you ever been in the situation where you're upgrading the BIOS on your computer and the whole thing freezes and crashes, killing your BIOS?

Some fancy motherboards have a backup of the BIOS, but not my Toshiba Satellite Pro.

But, what my laptop does have is the BIOS stored in a standard SPI flash chip (a 25F16 to be precise - 16 megabit [2 megabyte] flash chip).

"So", I think to myself, "all is not lost. I have the BIOS image, and I have a Fubarino SD. All I need to do is make them all talk together."

And so I did.

My Toshiba laptop is now working again, and I have a little SPI flash chip programming sketch out of it all. I also wrote a little PERL program to upload the BIOS image through serial.

The whole thing is command-line controlled through serial, and should work on any chipKIT board.

The commands are:

No guarantees it'll work with any flash chip, but it works with the one I have in my Tosh.


Sun, 22 Sep 2013 03:30:08 +0000

This is SO COOL! It would take me way longer than a day to do this. Very nice job.



Tue, 24 Sep 2013 13:10:31 +0000

What would be cooler is if I were to wrap the flash side of things in a nice clean class that identified the chip you were talking to, and dealt with all the quirks of that chip. Yes, most of the chips work based around the same instruction set, but not all of them work in quite the same way. For instance, the 64MBit SST chips I have here, and the 16MBit chip in my Tosh don't work quite the same, and the code I wrote to program the SST one wouldn't program the F16, and the SST chip placed into the Tosh would operate, but was unable to write any BIOS settings to the chip (they do that these days instead of a separate battery backed CMOS RAM...).

So... While I have a small selection of chips here for experimenting with, if anyone would happen to have any spare SPI Flash chips kicking around (or I could even expand it to SPI SRAM chips too), feel free to send them over in my direction so I can start building up a nice universal SPI memory driver library.