开发板启动调试记录--nand启动

u-boot设置启动参数,在启动时候会传给kernel,如下方式修改了启动参数:
setenv bootargs "noinitrd root=/dev/nfs nfsroot=192.168.2.102:/work/nfs_root/first_fs ip=192.168.2.26:192.168.2.102:192.168.2.1:255.255.255.0::eth0:off init=/linuxrc console=ttySAC0"
内核解压缩之后,挂住。

多加了引号,正确参数:
setenv bootargs noinitrd root=/dev/nfs console=ttySAC0,115200 nfsroot=192.168.2.102:/nfsroot/rootfs ip=192.168.2.26:192.168.2.102:192.168.2.1:255.255.255.0::eth0:off init=/linuxrc mem=64M

设置之后,有错误提示:
NET: Registered protocol family 16
setenv bootargs noinitrd root=/dev/mtdblock3 rootfstype=yaffs2 rw console=ttySAC0,115200 init=/linuxrc mem=64M boot

设置gatewayip 之后提示信息:
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "mtdblock3" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00             256 mtdblock0 (driver?)
1f01            3072 mtdblock1 (driver?)
1f02          257024 mtdblock2 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
Backtrace:
[] (dump_backtrace+0x0/0x10c) from [] (dump_stack+0x18/0x1c)
 r7:c047a4e8 r6:c04b2020 r5:c380c000 r4:c381df40
[] (dump_stack+0x0/0x1c) from [] (panic+0x4c/0x124)
[] (panic+0x0/0x124) from [] (mount_block_root+0x178/0x234)
 r3:00000000 r2:c38556ec r1:c381df40 r0:c0409358
[] (mount_block_root+0x0/0x234) from [] (mount_root+0xb0/0xf4)
[] (mount_root+0x0/0xf4) from [] (prepare_namespace+0xf8/0x18c)
 r7:c04b1a04 r6:c002083c r5:c002083c r4:c002084c
[] (prepare_namespace+0x0/0x18c) from [] (kernel_init+0xc8/0xf4)
 r7:00000000 r6:c001f0d0 r5:c001ecb0 r4:c001f0d0
[] (kernel_init+0x0/0xf4) from [] (do_exit+0x0/0x620)
 r7:00000000 r6:00000000 r5:00000000 r4:00000000


第一个提示:VFS: Unable to mount root fs via NFS, trying floppy.
这是没有设置nfs server的原因,然后尝试其他方式启动。

根据提示,尝试修改:
setenv bootargs noinitrd root=/dev/mtdblock0 rootfstype=yaffs2 rw console=ttySAC0,115200 init=/linuxrc mem=64M boot

s3c2410-rtc s3c2410-rtc: setting system clock to 2014-02-07 13:40:48 UTC (1391780448)
yaffs: dev is 32505856 name is "mtdblock0"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.0, "mtdblock0"
yaffs: NAND geometry problems: chunk size 2048, type is yaffs2, inbandTags 0
List of all partitions:
1f00             256 mtdblock0 (driver?)
1f01            3072 mtdblock1 (driver?)
1f02          257024 mtdblock2 (driver?)
No filesystem could mount root, tried:  yaffs2
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(31,0)
Backtrace:
[] (dump_backtrace+0x0/0x10c) from [] (dump_stack+0x18/0x1c)
 r7:c047a4e8 r6:c04b2020 r5:c380c000 r4:c381df40
[] (dump_stack+0x0/0x1c) from [] (panic+0x4c/0x124)
[] (panic+0x0/0x124) from [] (mount_block_root+0x1d8/0x234)
 r3:00000029 r2:c381df53 r1:c381df40 r0:c0409358
[] (mount_block_root+0x0/0x234) from [] (mount_root+0xb0/0xf4)
[] (mount_root+0x0/0xf4) from [] (prepare_namespace+0xf8/0x18c)
 r7:c04b1a04 r6:c002083c r5:c002083c r4:c002084c
[] (prepare_namespace+0x0/0x18c) from [] (kernel_init+0xc8/0xf4)
 r7:00000000 r6:c001f0d0 r5:c001ecb0 r4:c001f0d0
[] (kernel_init+0x0/0xf4) from [] (do_exit+0x0/0x620)
 r7:00000000 r6:00000000 r5:00000000 r4:00000000


根据手册提示,不同大小的nandflash生成根文件系统的工具不同,64M用的是mkyaffsimage_2,生成的root 大概50多兆;128M使用的是mkyaffs2image,生成20多兆。
然后修改启动参数:
setenv bootargs noinitrd root=/dev/mtdblock2 rootfstype=yaffs2 rw console=ttySAC0,115200 init=/linuxrc mem=64M boot
改为从nandflash启动,ok。

但是,nor方式,bootsystem 还是panic。

你可能感兴趣的:(智能家居)