HP iPAQ 210 / 214 - Flash
Home | How-To Install | Downloads | News | Developers' Info | Hardware | Wifi | Flash |
Below are the instructions to create a complete backup of the existing flash and to put linux on your device permenantly. In theory, recovering the backup at a later date will recover windows CE and I have managed to do this successfully on my own device now. However, if the flash chip develops bad blocks between flashing linux or re-flashing winCE the recovery may not work.
At no point in this proceedure is the first stage boot loader (called the OEM Boot Module/OBM) overwritten and both the U-Boot and Linux here have low-level safeguards to stop it being overwritten. This means that you should always be able to boot linux from the MMC card and so it shouldn't be possible to 'brick' the device completely.
Having said this, the instructions listed here are for information only and so anything you do with your own equipment is at your own risk.
First, you will need to follow the instructions on the How-To Install page so you are able to boot from the MMC card. You will need to do this using the March 2009 or later U-Boot bootloader and kernel files. Operating the flash after booting from winCE (HaRET) is not supported because you can't be sure of state of flash without a full reset.
Creating a Backup
To backup the existing flash you will need to be booting from an MMC card with enough free space (after copying the rootFS onto it) to hold the 256MB flash image.-
Reboot the iPAQ and select option 2 from the bootloader menu. The iPAQ should appear to boot linux from the MMC card as normal.
-
Log-in and start a root shell/terminal.
-
Type 'cat /proc/mtd' and check that the output looks like the following:
-
Type the following to copy the entire flash to a file:
-
Shutdown linux and copy the saved flash file from the MMC card to somewhere safe.
root@ipaq214:~# cat /proc/mtd dev: size erasesize name mtd0: 10000000 00020000 "All"
nanddump -f /home/root/flash-backup.bin /dev/mtd0
This will take about 5 minutes and the resulting file should be 264MB (276824064 bytes). If the file is not this size something may have gone wrong. You can change the file-name if you want to put the flash image somewhere else.
If you see any messages about bad blocks during this proceedure then the backup recovery may not work completely so only flash linux if you are willing to lose winCE.
Flashing Linux
-
Download the latest UBI image file to somewhere on your MMC card.
-
Reboot the iPAQ and select option 3 from the bootloader menu. The iPAQ should appear to boot linux from the MMC card as normal.
-
Log-in and start a root shell/terminal.
-
Type 'cat /proc/mtd' and check that the output looks like the following:
-
Type the following commands to erase the 3 required partitions. Be careful to get the numbers correct.
-
Type the following to flash U-Boot to partition 3:
-
Type the following to flash the kernel U-Boot image to partition 3:
-
Type the following to flash the RootFS image.
-
If you want to test it at this point, or add files to the rootFS on the flash, you can mount it as follows:
-
Reboot the iPAQ without holding the two buttons and U-Boot should appear.
-
Remove the MMC card and select option 4 to boot entirely from flash.
root@ipaq214:~# cat /proc/mtd dev: size erasesize name mtd0: 00021000 00020000 "Unknown0" mtd1: 00010000 00020000 "OBM1" mtd2: 0000f000 00020000 "OBM2" mtd3: 00040000 00020000 "U-Boot" mtd4: 00400000 00020000 "Kernel" mtd5: 0ec00000 00020000 "RootFS" mtd6: 00c00000 00020000 "test" mtd7: 00380000 00020000 "Unknown2"This shows how the flash is divided up into partitions for Linux to be installed.
flash_eraseall /dev/mtd3 flash_eraseall /dev/mtd4 flash_eraseall /dev/mtd5Ignore any warnings about bad blocks on the last command (/dev/mtd5). If you have bad blocks in /dev/mtd3 or /dev/mtd4 this proceedure won't work so e-mail the mailing list for help.
dd if=/media/mmcblk0p1/bldiag.nb0 of=/dev/mtdblock3 bs=2048 count=128If necessary, change the 'if=' parameter to wherever your U-Boot image is. Normally it is on the FAT partition of the MMC card.
dd if=/media/mmcblk0p1/uImage-ipaq214.bin of=/dev/mtdblock4 bs=2048 count=2048If necessary, change the 'if=' parameter to wherever your kernel U-Boot image is. Normally it is on the FAT partition of the MMC card.
ubiformat /dev/mtd5 -f angstrom-x11-image-2009xxxx.ubi.imgChange the file name to wherever you've put the UBI image.
ubiattach /dev/ubi_ctrl -m 5 mount -t ubifs ubi0:RootFS /mntBe sure to unmount it before resetting the iPAQ.
Recovering the Backup
WARNING: While this should work and has been shown to work, it remains possible that you will not be able to recover winCE with this backup proceedure. If this happens, get it contact on the mailing list and I'll see if I can help.
NOTE: Make sure you have the latest version of U-Boot for this.
-
Copy the flash backup file e.g. 'flash-backup.bin' to the MMC card.
-
Boot the iPAQ and select option 2 from the bootloader menu. The iPAQ should appear to boot linux from the MMC card as normal.
-
Log-in and start a root shell/terminal.
-
Type 'cat /proc/mtd' and check that the output looks like the following:
-
Type the following to erase the flash:
-
Type the following to write the backup image to flash:
root@ipaq214:~# cat /proc/mtd dev: size erasesize name mtd0: 10000000 00020000 "All"
flash_eraseall /dev/mtd0Ignore any bad-block errors.
nandwrite -o -n /dev/mtd0 flash-backup.binThis has to complete 2048 'blocks' and will take a very long time (~1hr 30mins).