flash image from SD card

Willie Chen willie_chen at openmoko.com
Sun Mar 30 06:52:43 CEST 2008


>
> Hmm, that's an odd problem. First, can you please check that you're
> indeed flashing the environment, i.e., that the file name and the
> device name you're passing to nandwrite are indeed correct ? The
> output of your script run with -x could be useful for checking this.
> (Change the #/bin/sh to #/bin/sh -x)
>   
> If this doesn't help to solve the problem, could you please send me
> the following information (in private mail, due to the various
> binary attachments) ?
>
>
> - the script output, as described above
>   

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

> - printenv from u-boot
>   

Before we flash images, the uboot environment are as following:

boot_menu_timeout=300
bootargs_base=rootfstype=jffs2 root=/dev/mtdblock6 console=tty0 
console=ttySAC2,115200 loglevel=3
bootcmd=dynpart ; saveenv ; setenv bootargs ${bootargs_base} 
${mtdparts}; nand read.e 0x32000000 kernel; bootm 0x32000000
bootdelay=1
menu_1=Boot from microSD: dynpart ; saveenv ; mmcinit ; fatload mmc 1 
0x32000000 uImage.bin; setenv bootargs roofstype=ext2 
root=/dev/mmcblk0p2 console=ttySAC2,115200 loglevel=6 ${mtdparts} 
init=/etc/startup; bootm 0x32000000
menu_2=Set console to USB: setenv stdin usbtty; setenv stdout usbtty; 
setenv stderr usbtty
menu_3=Set console to serial: setenv stdin serial; setenv stdout serial; 
setenv stderr serial
menu_4=Power off: neo1973 power-off
menu_5=Factory reset: defaultenv; dynpart; bootd
quiet=1
sd_image_name=uImage
splashimage=nand read.e 0x32000000 splash 0x5000; unzip 0x32000000 
0x33d00000 0x96000
stderr=serial
stdin=serial
stdout=serial
mtdids=nor0=physmap-flash,nand0=neo1973-nand
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

Then we flash u-boot and u-boot_env partitions

NAND read: mtdparts variable not set, see 'help mtdparts'
incorrect device type in kernel
'kernel' is not a number
## Booting image at 32000000 ...
Bad Magic Number
GTA02v5 # printenv
rrect device typootargs ${bootargs_base} ${mtdparts}; nand read.e 
0x32000000 kernel; bootm 0x32000000
bootdelay=3
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
pcf50633_int1=0x8c
pcf50633_int2=0x00
bootargs=rootfstype=jffs2 root=/dev/mtdblock6 console=ttySAC2,115200 
console=tty0 loglevel=8

Environment size: 460/262140 bytes

> - cat /proc/mtd from Linux
>   

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"

> - the environment image you're trying to flash
> - env_linux.bin, created with
>   nanddump -b -o -f env_linux.bin /dev/mtd2
>   after flashing the environment from Linux
>   

Okay.

> - env_dfu.bin, created with
>   nanddump -b -o -f env_dfu.bin /dev/mtd2
>   after flashing the environment with DFU
>
>   

Okay.


Regards,
Willie
-------------- 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/20080330/49a93bee/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: env_dfu.bin
Type: application/octet-stream
Size: 262144 bytes
Desc: not available
Url : http://lists.openmoko.org/pipermail/openmoko-kernel/attachments/20080330/49a93bee/attachment-0001.bin 


More information about the openmoko-kernel mailing list