Documentation
Developer how to's
Reflashing using a serial connection and a CF card You will still require a serial console connection in order to enter the reflashing commands, but the image data for the linux kernel and root file system can be transfered direcly from the memory card. If you don't know how to do so, see the section on Setting up a serial connection .
Your development machine will need a built-in or USB adaptor for your flash memory card for this step. Your memory card must be formatted with the FAT file system since u-boot will not be able to read other file systems.
Copy your rootfs and uimage files to the memory card using your choice of command line or GUI utility. If you wish to update u-boot you should also copy over the u-boot.bin image (this will only be necessary in extremely rare circumstances). The instructions below assume you have named your linux kernel, root file system, and u-boot images: uimage, rootfs, and uboot.bin respectively.
To prevent data corruption, make sure to umount (command line) or unmount/eject (GUI) your memory card volume before removing it from your development machine's adaptor.
Now physically transfer the memory card form your development machine to the slot on your gumstix expansion card or motherboard.
Normally you will only be replacing the root file system and kernel images. If you find it necessary, the instructions for reflashing u-boot are located at the end of this page.
Reboot your gumstix system and quickly press a key to enter the u-boot command mode:
U-Boot 1.2.0 (Jan 21 2008 - 09:22:10) - PXA270@600 MHz - 1578M *** Welcome to Gumstix *** DRAM: 128 MB Flash: 32 MB Using default environment Hit any key to stop autoboot: 0 GUM>
Next initialize the CF system by typing the pinit on command:
GUM> pinit on
HITACHI FLASH 5.0
Fixed Disk Card
IDE interface
[silicon] [unique] [single] [sleep] [standby] [idle] [low power]
Bus 0: OK
Device 0: Model: Hitachi XXM2.3.0 Firm: Rev 3.00 Ser#: 0X02 102300112513472
Type: Removable Hard Disk
Capacity: 244.3 MB = 0.2 GB (500400 x 512)
GUM>
To see what files you have on your memory card you can use the fatls command:
GUM> fatls ide 0 161432 uboot.bin 992696 uimage 9649540 rootfs 3 file(s) GUM>
Now, lets load the rootfs image into memory:
GUM> fatload ide 0 a2000000 rootfs reading rootfs 9649540 bytes read GUM>
Getting the new filesystem copied into flash memory is a two-step process. First, the old filesystem must be erased; then, the new filesystem must be written from RAM to flash.
To erase the old filesystem, enter:
GUM> protect on 1:0-1 Protect Flash Sectors 0-1 in Bank # 1 .. done GUM> erase all Erase Flash Bank # 1 - Warning: 2 protected sectors will not be erased! ................................................................................................................................................................................................................................................................. done GUM>
The first command protects flash sectors 0 and 1, which contain the uboot bootloader. This line is very important! If you omit it, your Gumstix will be unusable and will have to be reflashed at the factory using a far more complicated process. The second line erases all of flash except the 2 sectors that we just protected.
Now, commit your new filesystem to flash:
GUM> cp.b a2000000 40000 ${filesize}
Copy to Flash... done
GUM>
This copies your new filesystem into flash (at address 40000). ${filesize} is a reference to the variable filesize, which was set by your file transfer.
We now use a similar process to load the kernel image into memory:
GUM> fatload ide 0 a2000000 uimage reading uimage 992696 bytes read GUM>
There are special commands to help you install and run the kernel image:
GUM> katinstall 100000 Copying kernel from 0xa2000000 to 0x01f00000 (length 0x00100000)...Erasing... ........... done Erased 11 sectors Writing...done GUM> katload 100000 Copying kernel to 0xa2000000 from 0x01f00000 (length 0x00100000)...done GUM>bootm
That's it! You have replaced your root file system and kernel images and at this point should be seeing linux's boot messages scrolling by on your screen.
It is not normally necessary to reflash U-boot. Proceed with the following only if you are absolutely certain that you need to update U-boot.
It is quite possible to "brick" your gumstix motherboard if you do not follow these instructions accurately. Please be careful!
NOTE: At the moment gumstix-oe does not build U-Boot. If you need to update U-Boot you can find pre-built binaries at:
http://www.gumstix.net/feeds/u-boot
The instructions below assume that you have stored a copy of the U-boot binary on your memory card as uboot.bin
The first step is to initialize the PCMCIA/CF system and read the U-boot image into memory:
GUM> pinit on
HITACHI FLASH 5.0
Fixed Disk Card
IDE interface
[silicon] [unique] [single] [sleep] [standby] [idle] [low power]
Bus 0: OK
Device 0: Model: Hitachi XXM2.3.0 Firm: Rev 3.00 Ser#: 0X02 102300112513472
Type: Removable Hard Disk
Capacity: 244.3 MB = 0.2 GB (500400 x 512)
GUM> fatload ide 0 a2000000 uboot.bin
reading uboot.bin
161432 bytes read
GUM>
Getting the new u-boot copied into flash memory is a two-step process. First, the old u-boot image must be erased; then the new u-boot image must be written from RAM to flash.
To erase the old u-boot image:
GUM> protect off all Un-Protect Flash Bank # 1 ................................................................................................................................................................................................................................................................... done GUM> erase 1:0-1 Erase Flash Sectors 0-1 in Bank # 1 .. done GUM>
Now we flash the new u-boot image:
Note: this command is very similar to the command you normally use to reflash the rootfs. Note that the address is 0 not 4000! Be carefully not to mistype this!
GUM> cp.b a2000000 0 ${filesize}
Copy to Flash... done
GUM>reset
At this point your system will reboot and execute the new u-boot image.