2013-11-24 11:09:47

Writing a flash chip with a programming cable

If you have a broken BIOS (BIOS update failed) or if you have "bricked" router then you need some kind of programming device to write a new firmware into the flash chip. Most of these chips are NOR flash chips which can be written by SPI.

I wanted to replace a 4 MB flash with a 8 MB chip and wanted to "burn" at least a boot loader (in this case U-Boot) to the virgin chip. I didn't want to buy a professional programmer like Batronix because I just wanted to write flash chips with SPI which is actually a most simple serial protocol. These were my specs:

ready to use (no assembling of PCB and soldering)

writing flash chips by SPI

software available (also ready to use), with preference of open source software and support for some kind of unix os (Linux, BSD etc.)

cheap

Searching the web I discovered some "open source" solutions like Openbiosprog-spi or RushSPI. Both projects are well done and even the hardware is published under a free license. Both projects don't offer software of their own but need the free software flashrom. Although the hardware is licensed under the free CC-BY-SA, is cheap and the PCB layouts are available online, they fail on one important spec: ready to use. But both projects use an FTDI chip. Searching FTDI's website I detected a very interesting cable: C232HM-DDHSL-0. Because the chip in this cable is the same chip like used in RushSPI you can also use flashrom as writing software.

I ordered the cable for ~ 20 EUR and connected the flash rom MX25L6406 via a self built adapter to the cable. This is the wiring:

After compiling flashrom (and libftdi) the software said that it couldn't detect a known chip. A quick search lead me to this page: ftdi-d2xx-linux-overcoming-big-problem. I just forgot my serial cable with the latest FTDI VCP serial driver! This "virtual com port" driver already knows the FT232H chip and is able to control these chips when they are connected to USB. After deactivating the support for the FT232H in the VCP driver I was able to "see", read and write my connected flash chip with flashrom and libftdi.