flash image from SD card

Willie Chen willie_chen at openmoko.com
Mon Mar 31 13:47:21 CEST 2008


[...]
>
> If the problem still exists, can you please bring the system to the
> state it's in before flashing, and then repeat the procedure, and send
> the exact output you're getting, snapshots of /dev/mtd2 ? I.e.,
>
> - bring system to original state (devirginate ?)
>   

Yes. I roll back to factory's uboot that has boot menu and
use have four boot menus environment.

> - boot into Linux
>   

Then I boot into DM2.

> - cat /proc/mtd
>   

root@(none):~$ cat /proc/mtd
dev: size erasesize name
mtd0: 00200000 00010000 "physmap-flash.0"
mtd1: 00040000 00020000 "u-boot"
mtd2: 00040000 00020000 "u-boot_env"
mtd3: 00800000 00020000 "kernel"
mtd4: 000a0000 00020000 "splash"
mtd5: 00040000 00020000 "factory"
mtd6: 0f6a0000 00020000 "rootfs"

> - nanddump -b -o -f env_before.bin /dev/mtd2
>   
Ok.

> - do the flashing (with -x, send the output)
>   
> - do the flashing of env-5secs.env from Linux
>   

root@(none):~$ flashimage /dev/mtd2 /home/root/env-5secs.env
+ [ -z /dev/mtd2 -o -z /home/root/env-5secs.env -o ! -z ]
+ dev=/dev/mtd2
+ image=/home/root/env-5secs.env
+ erase
+ flash_eraseall -q /dev/mtd2
+ nandwrite -p -q /dev/mtd2 /home/root/env-5secs.env


> - nanddump -b -o -f env_linux.bin /dev/mtd2
>   

Ok.

> - reset and send what you're seeing one the console(s)
>
>   

Then uboot can read the env-5secs.env.

GTA02v5 # printenv
bootargs=
bootcmd=setenv bootargs ${bootargs_base} ${mtdparts}; nand read.e 
0x32000000 kernel; bootm 0x32000000
baudrate=115200
usbtty=cdc_acm
stderr=usbtty
stdout=usbtty
stdin=usbtty
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock6 
console=ttySAC2,115200 console=tty0 loglevel=8
mtdids=nor0=physmap-flash,nand0=neo1973-nand
bootdelay=5
mtdparts=mtdparts=physmap-flash:-(nor);neo1973-nand:0x00040000(u-boot),0x00040000(u-boot_env),0x00800000(kernel),0x000a0000(splash),0x00040000(factory),0x0f6a0000(rootfs)
partition=nor0,0
mtddevnum=0
mtddevname=nor
Environment size: 554/262140 bytes

We press power key to choose boot in boot menu. Then we can boot the 
kernel and rootfs from NAND flash.
Maybe the problem is if we flash u-boot image from linux, then we can't 
read correctly environment.

Regards,
Willie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: env_before.bin
Type: application/octet-stream
Size: 262144 bytes
Desc: not available
Url : http://lists.openmoko.org/pipermail/openmoko-kernel/attachments/20080331/04c1ac94/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: env_linux.bin
Type: application/octet-stream
Size: 262144 bytes
Desc: not available
Url : http://lists.openmoko.org/pipermail/openmoko-kernel/attachments/20080331/04c1ac94/attachment-0001.bin 


More information about the openmoko-kernel mailing list