SPI FLASH Recovery for XO-1.75 Using CForth

From OLPC
Revision as of 06:09, 12 July 2011 by Wmb@firmworks.com (talk | contribs) (SPI FLASH recovery of XO-1.75 with CForth)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

If you have an XO-1.75 that will run CForth but will not run OFW, possibly because you are a firmware developer and have installed a test version whose OFW component is horribly broken, you can load a new version of OFW into the SPI FLASH from CForth.

Make a file that contains only the OFW portion of the image file:

 $ dd if=q4b03.rom of=justofw.rom bs=128k skip=1

Obviously, replace q4b03.rom with the name of the file containing the OFW bits you want.

Attach a serial port to your semi-dead XO-1.75.

Make sure your terminal emulator supports binary mode downloads. For minicom, this typically requires an auxiliary "bin-xfr" program - see http://dev.laptop.org/~wmb/bin-xfr.c , http://dev.laptop.org/~rsmith/bin-xfr.c , or http://www.dannysung.com/wmain/linux/tips/sending-binary-files-via-minicom/ . For TeraTERM, check the Binary option in the Send File dialog.

Get into CForth by holding down the rotate key and powering on.

 ok init-spi .spi-id
 ok 100000 0 do key i c! loop
 <Send justofw.rom over serial, in binary mode>
 ok 20000 e0000 20000 reflash


You can reflash the whole thing if you prefer, but I tend to be conservative in this state, not wanting to risk screwing up CForth. But for completeness, here is the recipe for reflashing the whole thing:

 ok init-spi .spi-id
 ok 100000 0 do key i c! loop
 <Send a rom image file, e.g. q4b03.rom, over serial, in binary mode>
 ok reflash0