On this Page


Flashing with Linux

We recommend using the Linux mtd utilities to write images to flash. This will require a bootable microSD card, which you can create by following the instructions posted in Create Bootable microSD Card.

Now, copy the image files, and the script below, to the microSD card (for example to /home/root/images). You may need to modify the script to reflect the names of your image files. Make sure the script is marked as executable.

View Script

Unmount the microSD card from your development machine, insert in the Overo microSD slot and boot.

Login and run the script. If you are using a zImage rather than a uImage, it gets flashed as part of the rootfs---just leave the uimage variable blank. Some users have reported that 'flash_erase /dev/mtdX 0' erases the partition where the syntax 'flash_erase /dev/mtdX 0 0' fails---this seems to occur on version 1.4.1 of mtd_utils (check with 'smart info mtd-utils').


Replacing MLO

The Overo COM bootstrap loader MLO (x-load) requires 1-bit hardware error checking which is only available within the u-boot environment. The following commands issued at the u-boot prompt write four copies of an MLO (filename="MLO") from the FAT partition of a microSD card to Flash memory on the COM. Four copies are used for redundancy in case of corruption.

View the Commands


Flash MLO with a U-Boot Script

Alternatively, you can write a u-boot script to flash MLO.

$ nano flash-MLO.cmd
load mmc 0 ${loadaddr} MLO
nandecc hw
nand erase.part xloader
nand write ${loadaddr} 0x0 ${filesize}
nand write ${loadaddr} 0x20000 ${filesize}
nand write ${loadaddr} 0x40000 ${filesize}
nand write ${loadaddr} 0x60000 ${filesize}

Make the script readable by u-boot.

$ mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "flash-MLO" -d flash-MLO.cmd flash-MLO.scr

Copy flash-MLO.scr to your boot partition, insert the microSD card in your COM and wait for u-boot to load from mmc. Interrupt the boot process when you see Hit any key to stop autoboot and enter these commands.

# mmc rescan 0; fatload mmc 0 ${loadaddr} flash-MLO.scr; source ${loadaddr}

Flashing with U-Boot

It is possible to completely reflash the COM (MLO, u-boot, kernel, root file system) from u-boot. First, you need to prepare a bootable microSD card. Then copy the files you wish to flash to the '/boot' directory on the rootfs partition. For example:

# assume the rootfs is mounted at /media/rootfs/
$ cd /media/rootfs/boot
$ wget https://s3-us-west-2.amazonaws.com/gumstix-yocto/2015-02-25/overo/master/MLO
$ wget https://s3-us-west-2.amazonaws.com/gumstix-yocto/2015-02-25/overo/master/u-boot.img
$ wget https://s3-us-west-2.amazonaws.com/gumstix-yocto/2015-02-25/overo/master/gumstix-console-image-overo.ubi -O rootfs.ubi

Now create a script to write the files to flash.

$ nano flash-all.cmd
nand erase.chip

# switch to 1-bit ECC and write MLO
load mmc 0:2 ${loadaddr} /boot/MLO
nandecc hw
nand write ${loadaddr} 0x0 ${filesize}
nand write ${loadaddr} 0x20000 ${filesize}
nand write ${loadaddr} 0x40000 ${filesize}
nand write ${loadaddr} 0x60000 ${filesize}

# switch back to BCH8 and write u-boot
nandecc sw bch8
load mmc 0:2 ${loadaddr} /boot/u-boot.img
nand write ${loadaddr} u-boot ${filesize}

# write the kernel (if uImage...otherwise skip)
load mmc 0:2 ${loadaddr} /boot/uImage
nand write ${loadaddr} linux ${filesize}

# write the filesystem
load mmc 0:2 ${loadaddr} /boot/rootfs.ubi
nand write ${loadaddr} rootfs ${filesize}

To make the script readable by u-boot, use the following command (assuming the boot partition is mounted at /media/boot

$ mkimage -A arm -O linux -T script -C none -a 0 -e 0 -n "flash-all" -d flash-all.cmd /media/boot/flash-all.scr

Unmount, insert the microSD card in your COM and wait for u-boot to load from mmc. Interrupt the boot process when you see Hit any key to stop autoboot and enter these commands.

# mmc rescan 0; load mmc 0 ${loadaddr} flash-all.scr; source ${loadaddr}

Remove the SD card and restart your system. If all went well, your system should start normally.