Chinaunix首页 | 论坛 | 博客
  • 博客访问: 208667
  • 博文数量: 56
  • 博客积分: 1085
  • 博客等级: 少尉
  • 技术积分: 652
  • 用 户 组: 普通用户
  • 注册时间: 2011-09-29 13:50
文章分类
文章存档

2014年(4)

2012年(25)

2011年(27)

我的朋友

分类: 嵌入式

2014-02-18 17:14:59



还是无法启动!!!!
看看jz2440的原uboot 内核  根文件是否可以使用??
/**********************************************************************************/
2014/1/26 16:08:09
又是出现板子无法和linux服务器nfs。
解决:
1.修改本地宽带连接,与无线网络同一个网段。
2.断开无线网
3.修改开发板的网络信息
4.进入linux主机中修改nfs服务器配置信息
5.然后在终端重启nfs服务器service nfs restart,使其生效。
nfs 30000000 10.1.30.100:/home/hyx/linux-2.6.33/arch/arm/boot/uImage_jz2440
bootm 30000000


drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
Root-NFS: No NFS server available, giving up.
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "hda1" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
1f00        256 mtdblock0 (driver?)
1f01        128 mtdblock1 (driver?)
1f02       2048 mtdblock2 (driver?)
1f03     128640 mtdblock3 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)




nfs 30000000 10.1.30.100:/home/hyx/linux-2.6.33/arch/arm/boot/uImage
bootm 30000000
出现如下信息:
Please append a correct "root=" boot option; here are the available partitions:
1f00             256 mtdblock0 (driver?)
1f01             128 mtdblock1 (driver?)
1f02            2048 mtdblock2 (driver?)
1f03          128640 mtdblock3 (driver?)
Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(2,0)
Backtrace: 
[] (dump_backtrace+0x0/0x104) from [] (dump_stack+0x18/0x1c)
 r7:c0c7a000 r6:c0c7a02a r5:00000000 r4:c0c1df5c
[] (dump_stack+0x0/0x1c) from [] (panic+0x3c/0x124)
[] (panic+0x0/0x124) from [] (mount_block_root+0x1d8/0x21c)
 r3:00000000 r2:20000013 r1:c0c1df5c r0:c038619c
[] (mount_block_root+0x0/0x21c) from [] (mount_root+0xd0/0xf0)
[] (mount_root+0x0/0xf0) from [] (prepare_namespace+0x170/0x1d0)
 r6:00000000 r5:c0029a0c r4:c040e134
[] (prepare_namespace+0x0/0x1d0) from [] (kernel_init+0xd8/0x10c)
 r5:c0028530 r4:c040df18
[] (kernel_init+0x0/0x10c) from [] (do_exit+0x0/0x5a4)
 r5:00000000 r4:00000000


nfs 30000000 10.1.30.100:/home/hyx/nfs_root_hyx/fs_mini_hyx.yaffs2
OK2440_hyx#bootm 30000000
## Booting image at 30000000 ...
Bad Magic Number


nfs 30000000 10.1.30.100:/home/hyx/nfs_root_hyx/fs_mini_jz2440.yaffs2
nand erase 260000 FDA0000  (yaffs)
问题:
OK2440_hyx#nand erase 260000 FDA0000


NAND erase: device 0 offset 0x260000, size 0xfda0000
Skipping bad block at  0x00500000      一个坏块为128KB =(0x00520000-0x00500000=20000=131072byte)/1024=  128KB                               
Skipping bad block at  0x00520000                                            
Skipping bad block at  0x00540000                                            
Skipping bad block at  0x00560000                                            
Skipping bad block at  0x00580000                                            
Skipping bad block at  0x005a0000                                            
Skipping bad block at  0x005c0000                                            
Skipping bad block at  0x005e0000                                            
Skipping bad block at  0x00600000                                            
Skipping bad block at  0x00620000                                            
Skipping bad block at  0x00640000                                            
Skipping bad block at  0x00660000                                            
Skipping bad block at  0x00680000                                            
Skipping bad block at  0x006a0000                                            
Skipping bad block at  0x006c0000                                            
Skipping bad block at  0x006e0000                                            
Skipping bad block at  0x03760000                                            
Skipping bad block at  0x03780000                                            
Skipping bad block at  0x037a0000                                            
Erasing at 0x7ea0000 --  49% complete.      //   0x7ea0000-0x260000= 128MB
NAND 128MiB 3,3V 8-bit: MTD Erase failure: -22


NAND 128MiB 3,3V 8-bit: MTD get bad block failed: -22
ERROR
OK2440_hyx#nand erase 60000 200000


NAND erase: device 0 offset 0x60000, size 0x200000
Skipping bad block at  0x00180000                                            
Skipping bad block at  0x001a0000                                            
Skipping bad block at  0x001c0000                                            
Skipping bad block at  0x001e0000                                            
Erasing at 0x240000 -- 100% complete.
OK
nand erase 60000 200000    (kernal)
nand erase 40000 20000     (param)
nand write.yaffs 0x30000000 0x00260000 $(filesize)


nand erase 260000 2000000
/**********************************************************************************/
2014/1/28 9:36:42
之前不小心将uboot分区给删去了,重新下了uboot后出现
OK2440_hyx#nfs 30000000 10.1.30.100:/home/hyx/linux-2.6.33/arch/arm/boot/uImage_jz2440
nfs 30000000 10.1.30.100:/home/hyx/linux-2.6.33/arch/arm/boot/uImage
dm9000 i/o: 0x20000000, id: 0x90000a46 
DM9000: running in 16 bit mode
MAC: 00:00:00:00:00:00
could not establish link
*** ERROR: `ethaddr' not set
设置MAC地址
setenv ethaddr 00:0c:29:4d:e4:f4
jz2440内核分区表
Creating 4 MTD partitions on "NAND 128MiB 3,3V 8-bit":
0x00000000-0x00040000 : "bootloader"
0x00040000-0x00060000 : "params"
0x00060000-0x00260000 : "kernel"
0x00260000-0x08000000 : "root"


nand erase 60000 200000
nand write 30000000 60000 200000
set bootcmd 'nand read 30000000 kernel;bootm 30000000'


nfs 30000000 10.1.30.100:/home/hyx/nfs_root_hyx/fs_mini_jz2440.yaffs2


nand erase 260000 900000
nand write.yaffs 30000000 260000 $(filesize)
set bootargs console=ttySAC0 root=/dev/mtdblock3 rootfstype=yaffs2


nfs 30000000 10.1.30.100:/home/hyx/linux-2.6.33/arch/arm/boot/uImage_jz2440
nand erase 60000 200000
nand write 30000000 60000 200000
set bootcmd 'nand read 30000000 200000;bootm 30000000'
下载烧入内核后总是出现如下情况:
NAND read: device 0 offset 0x60000, size 0x200000
 2097152 bytes read: ERROR
## Booting image at 30080000 ...
   Image Name:   Linux-2.6.22.6
   Created:      2010-12-24   2:18:18 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    1846796 Bytes =  1.8 MB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... Bad Data CRC
尝试各种方法还是失败!!!!
年后,使用OK2440自身带的uboot,试试使用自己移植的linux(记是针对ok2440的uboot分区移植)
或是修改uboot和内核的mtd分区!!给内核足够大的分区!!(怀疑是坏块的原因)
如果坏块较多映像存储,无法解决,则购买一个nand焊接。
/**********************************************************************************/
2014/2/11 13:45:34
修改了uboot分区,如下
0x00000000-0x00040000 : "bootloader"
0x00040000-0x00060000 : "params"
0x00060000-0x00A60000 : "kernel"
0x00A60000-0x08000000 : "root"
修改uboot源码
#define MTDPARTS_DEFAULT "mtdparts=nandflash0:256k@0(bootloader)," \
                            "128k(params)," \
                            "10m(kernel)," \
                            "-(root)"
                            
内核无法编译通过,总是出现如下错误:
fs/yaffs2/yaffs_fs.c:212: error: unknown field `prepare_write' specified in initializer
fs/yaffs2/yaffs_fs.c:212: warning: initialization from incompatible pointer type
fs/yaffs2/yaffs_fs.c:213: error: unknown field `commit_write' specified in initializer
fs/yaffs2/yaffs_fs.c:213: warning: initialization from incompatible pointer type
......................
fs/yaffs2/yaffs_fs.c: In function `yaffs_internal_read_super':
fs/yaffs2/yaffs_fs.c:1676: warning: int format, different type arg (arg 2)
fs/yaffs2/yaffs_fs.c: In function `init_yaffs_fs':
...................
fs/yaffs2/yaffs_fs.c:2278: error: `proc_root' undeclared (first use in this function)
make[2]: *** [fs/yaffs2/yaffs_fs.o] Error 1
make[1]: *** [fs/yaffs2] Error 2
make: *** [fs] Error 2


日后解决。
现将韦东山的2.6.22.6的内核和补丁用过来编译,然后修改内核分区,编译镜像。      
补丁命令:patch -p1 < ../linux-2.6.22.6_jz2440.patch    (具体分析见韦东山书籍第74页)
1.解压linux-2.6.22.6压缩文件
2.补丁:patch -p1 < ../linux-2.6.22.6_jz2440.patch
3.make s3c2410_defconfig,cp config_ok .config
4.make menuconfig
5.nfs 30000000 10.1.30.100:/home/hyx/linux-2.6.22.6/arch/arm/boot/zImage
/home/hyx/gcc-3.4.5-glibc-2.3.6/bin/arm-linux-objcopy -O binary -S vmlinux linux.bin
/home/hyx/u-boot-1.1.6/tools/mkimage -A arm -O linux -C none -a 0x30008000 -e 0x30008000 -d linux.bin /home/hyx/linux-2.6.22.6/arch/arm/boot/uImage
nfs 30000000 10.1.30.100:/home/hyx/linux-2.6.22.6/arch/arm/boot/uImage
bootm 30000000,但是出现了
Creating 4 MTD partitions on "NAND 128MiB 3,3V 8-bit":
0x00000000-0x00040000 : "bootloader"
0x00040000-0x00060000 : "params"
0x00060000-0x00260000 : "kernel" //分区没有改变
0x00260000-0x08000000 : "root"
s3c2410-ohci s3c2410-ohci: S3C24XX OHCI
s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1
s3c2410-ohci s3c2410-ohci: irq 42, io mem 0x49000000
usb usb1: configuration #1 chosen from 1 choice
hub 1-0:1.0: USB hub found


nand erase 60000 A00000
nand write 30000000 60000 A00000
set bootcmd 'nand read 30000000 kernel;bootm 30000000'
nand read 30000000 A00000
重启开发板后:
   Image Name:   
   Created:      2014-02-11   9:44:17 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3741284 Bytes =  3.6 MB
   Load Address: 30008000
   Entry Point:  30008000
   Verifying Checksum ... Bad Data CRC
失败!!!
/**********************************************************************************/
2014/2/12 13:50:49
认为还是坏块存在的原因。
坏块区域:
Skipping bad block at  0x00180000                                            
Skipping bad block at  0x001a0000                                            
Skipping bad block at  0x001c0000                                            
Skipping bad block at  0x001e0000                                            
Skipping bad block at  0x00500000                                            
Skipping bad block at  0x00520000                                            
Skipping bad block at  0x00540000                                            
Skipping bad block at  0x00560000                                            
Skipping bad block at  0x00580000                                            
Skipping bad block at  0x005a0000                                            
Skipping bad block at  0x005c0000                                            
Skipping bad block at  0x005e0000                                            
Skipping bad block at  0x00600000                                            
Skipping bad block at  0x00620000                                            
Skipping bad block at  0x00640000                                            
Skipping bad block at  0x00660000                                            
Skipping bad block at  0x00680000                                            
Skipping bad block at  0x006a0000                                            
Skipping bad block at  0x006c0000                                            
Skipping bad block at  0x006e0000                                            
Skipping bad block at  0x03760000                                            
Skipping bad block at  0x03780000                                            
Skipping bad block at  0x037a0000 
使用nand erase 命令全部擦除nand,结果还是有坏块。
使用最后命令nand scrub
OK2440_hyx_2.1#nand scrub


NAND scrub: device 0 whole chip
Warning: scrub option will erase all factory set bad blocks!
         There is no reliable way to recover them.
         Use this command only for testing purposes if you
         are sure of what you are doing!


Really scrub this NAND flash?
Erasing at 0x7fe0000 -- 100% complete.


OK2440_hyx_2.1#nand erase


NAND erase: device 0 whole chip
Erasing at 0x7fe0000 -- 100% complete.   0x7fe0000=127M
重修下uboot,修改参数
setenv ipaddr 10.1.30.200
setenv serverip 10.1.30.100
setenv ethaddr 00:0C:29:D1:47:C4
setenv netmask 255.255.255.0
setenv bootdelay 3
saveenv
nfs 30000000 10.1.30.100:/home/hyx/linux-2.6.22.6/arch/arm/boot/uImage_jz2440
nand erase 60000 200000
nand write 30000000 60000 200000
reset
nand read 30000000 kernel
bootm 30000000
成功!
是烧写yaffs文件
nfs 30000000 10.1.30.100:/home/hyx/nfs_root_hyx/fs_mini_hyx.yaffs2
nfs 30000000 10.1.30.100:/home/hyx/nfs_root_hyx/fs_mini_jz2440.yaffs2
nfs 30000000 10.1.30.100:/home/hyx/nfs_root_hyx/fs_mini_mdev.jffs2
nfs 30000000 10.1.30.100:/home/hyx/nfs_root_hyx/fs_mini.jffs2






nand erase 0x260000 0x7DA0000
nand write.yaffs 0x30000000 0x260000 $(filesize)
nand write.jffs2 0x30000000 0x260000 $(filesize)




set bootargs noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0 rootfstype=yaffs
set bootcmd 'nand read 30000000 kernel;bootm 30000000'
save
nand read.yaffs 0x30000000 kernel
nand read.jffs2 0x30000000 kernel
bootm 0x30000000
无法启动根文件系统!
试着使用网络nfs文件系统。
set bootargs noinitrd root=/dev/nfs nfsroot=10.1.30.100:/home/hyx/nfs_root_hyx/fs_mini_hyx ip=10.1.30.200:10.1.30.100:255.255.255.0::eth0:off init=/linuxrc console=ttySAC0
set bootcmd 'nand read.yaffs 30000000 kernel;bootm 30000000'
但也不行。
看来还是需要先将系统启动起来,才能顺利挂载nfs文件系统。
再重新编译自己的linux-2.6.33内核。还有在制作uImage时,解决如何将它缩小到2M以内。
/**********************************************************************************/
2014/2/13 14:46:22
使用了韦东山的uboot和image,yaffs2文件,可以正常启动!!
uboot:u-boot-jz2440.bin
image:nfs 30000000 10.1.30.100:/home/hyx/linux-2.6.22.6/arch/arm/boot/uImage_jz2440
nand erase 60000 200000
nand write 30000000 60000 200000
reset
boot
打印信息:
NET: Registered protocol family 1
drivers/rtc/hctosys.c: unable to open rtc device (rtc0)
yaffs: dev is 32505859 name is "mtdblock3"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.3, "mtdblock3"
yaffs: auto selecting yaffs2
VFS: Mounted root (yaffs filesystem).
Freeing init memory: 136K
Warning: unable to open an initial console.
Failed to execute /linuxrc.  Attempting defaults...
Kernel panic - not syncing: No init found.  Try passing init= option to kernel.


yaffs2:nfs 30000000 10.1.30.100:/home/hyx/nfs_root_hyx/fs_mini_jz2440.yaffs2
或nfs 30000000 10.1.30.100:/home/hyx/nfs_root_hyx/fs_mini_hyx.yaffs2(自己制作的fs文件可以使用)


nand erase 0x260000 0x7DA0000
nand write.yaffs 0x30000000 0x260000 $(filesize)
reset
boot
打印信息:
yaffs: dev is 32505859 name is "mtdblock3"
yaffs: passed flags ""
yaffs: Attempting MTD mount on 31.3, "mtdblock3"
yaffs: auto selecting yaffs2
VFS: Mounted root (yaffs filesystem).
Freeing init memory: 136K
init started: BusyBox v1.7.0 (2008-01-22 10:04:09 EST)
starting pid 765, tty '': '/etc/init.d/rcS'
eth0: link down


Please press Enter to activate this console. 
starting pid 768, tty '/dev/ttySAC0': '/bin/sh'

# eth0: link up, 100Mbps, full-duplex, lpa 0xCDE1
正常启动!
之后重新烧入自己的u-boot-hyx-v2.2.bin不行。
发现用自己的uboot启动内核记录中
Kernel command line: root=/dev/hda1 ro init=/bin/bash console=ttySAC0
此与uboot中的bootargs bootargs noinitrd root=/dev/mtdblock3 init=/linuxrc console=ttySAC0不同。
所以可能是造成无法启动内核的原因!
上网查找方法后得到:
在uboot-1.1.6/include/configs/ok2440.h中加入如下:
#define CONFIG_CMDLINE_TAG 1 /* enable passing of ATAGs */
#define CONFIG_SETUP_MEMORY_TAGS 1
#define CONFIG_INITRD_TAG 1
而#define CONFIG_CMDLINE_TAG 1是在传递cmdline时候必须设置的。
重新make all编译uboot。
得到镜像文件,可以顺利挂载image和我的根文件系统。
随后制作补丁文件!
diff -urNwB u-boot-1.1.6 u-boot-1.1.6-hyx > u-boot-1.1.6-hyx.diff
具体的命令参见韦东山书籍的74 page
/**********************************************************************************/
到此,uboot完全移植成功!!
但需要日后仔细分析启动过程和问题的原因!!!!!!!!!!






































































阅读(2038) | 评论(0) | 转发(0) |
0

上一篇:2013-arm实验记录

下一篇:2014-arm实验记录-2

给主人留下些什么吧!~~