一. 系统移植出现的问题总结
1. 系统启动卡在Freeing init memory: 176K
-
用 /opt/EmbedSky/4.3.3/bin/arm-none-linux-gnueabi-gcc编译之后系统启动卡在 Freeing init memory: 176K
-
换 /opt/EmbedSky/crosstools_3.4.5_softfloat/gcc-3.4.5-glibc-2.3.6/arm-linux/bin/arm-linux-gcc
2. 启动时提示 tmp 目录挂载不成功
-
VFS: Mounted root (yaffs filesystem).
-
Freeing init memory: 124K
-
mount: mounting tmpfs on /tmp failed: Invalid argument
-
mount: mounting tmpfs on /dev failed: Invalid argument
-
mount: mounting var on /dev failed: Invalid argument
-
can't open /dev/tq2440_serial0: No such file or directory
-
can't open /dev/tq2440_serial0: No such file or directory
-
can't open /dev/tq2440_serial0: No such file or directory
-
can't open /dev/tq2440_serial0: No such file or directory
-
-
解决方法:
-
配置内核参数make menuconfig
-
File systems
-
---> Pseudo filesystems
-
---> Virtual memory file system support(former shm fs)
-
---->Tmpfs POSIX Access Control Lists
3. 从nfs中启动时提示: VFS: Cannot open root device "nfs" or unknown-block(2,0)
-
eth0: link up, 100Mbps, full-duplex, lpa 0x4DE1
Looking up port of RPC 100005/3 on 192.168.6.119
VFS: Unable to mount root fs via NFS, trying floppy.
VFS: Cannot open root device "nfs" or unknown-block(2,0)
Please append a correct "root=" boot option; here are the available partitions:
-
-
解决方法: make menuconfig
-
File systems
-
--> [*] Network File Systems
-
---> Network File Systems
-
<*> NFS file system support
-
[*] Provide NFSv3 client support
-
[*] Provide NFSv4 client support (EXPERIMENTAL)
-
[*] Root file system on NFS
4. 启动时出现 Failed to execute /linuxrc.
-
1.烧写完文件系统后内核引导出现以下错误:
-
yaffs_read_super: isCheckpointed 0
-
VFS: Mounted root (yaffs filesystem) on device 31:2.
-
Freeing init memory: 184K
-
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.
-
Backtrace:
-
[] (dump_backtrace+0x0/0x12c) from [] (dump_stack+0x18/0x1c)
-
r7:00000000 r6:c001e07c r5:c03e553c r4:c03e4ef4
解决:
最后制作yaffs文件系统时用mkyaffs2image命令,
mkyaffsimage_2针对Nand
flash是64M的
-
以下引用自tq2440论坛:
-
http://bbs.embedsky.net/forum.php?mod=viewthread&tid=6422
-
遇到这样问题的网友可以根据下面的建议逐个检查。
-
a. bin/busybox文件是可以执行的。
-
b.在配置busybox的时候要选中shell选项中的一个选项
-
c. linuxrc是可执行的。
-
d.制作文件系统的时候利用的工具也要留意区分:
-
mkcramfs 制作cramfs镜像的工具
-
mkimage 制作jffs2镜像的工具
-
mkyaffs2image 制作2.6的yaffs2的镜像工具(针对Nand Flash是128MB到1GB的)
-
mkyaffsimage 制作2.6.13的yaffs2的镜像工具
-
mkyaffsimage_2 制作2.6.25.8或2.6.30.4或更高版本内核的yaffs2的镜像工具(针对Nand Flash是 64MB的)
-
e.你使用的是256MB的Nand Flash,而在配置内核的nand时选择ecc校验
5. 内核启动时出现data about
开机NorFlash启动,用的第1项烧写的内核
-
a.写内核
-
Enter your selection: 3
-
USB host is connected. Waiting a download.
-
-
Now, Downloading [ADDRESS:30000000h,TOTAL:2305446]
-
RECEIVED FILE SIZE: 2305446 (1125KB/S, 2S)
-
-
NAND erase: device 0 offset 0x200000, size 0x200000 -->这个size只有2M
-
Erasing at 0x3e0000 -- 100% complete.
-
OK
-
-
b. 读内核
-
Booting Linux ...
-
Copy linux kernel from 0x00200000 to 0x30008000, size = 0x00300000 ... Copy Kernel to SDRAM done,NOW, Booting Linux......
-
data abort --> 这个size是3M
-
pc : [<3000b420>] lr : [<0000005c>]
-
sp : 302441c4 ip : 30007fff fp : 302441e0
-
r10: 40000000 r9 : 30000000 r8 : 30008000
-
r7 : 30007fff r6 : 30007fff r5 : 30007fff r4 : 3023ad20
-
r3 : 000000a8 r2 : 302541e4 r1 : 302441e4 r0 : 302541e4
-
Flags: nzCv IRQs off FIQs off Mode SVC_32
-
Resetting CPU ...
-
-
*** Warning - bad CRC or NAND, using default environment
用NorFlash在烧写时,只烧了2M的内核,但实际上编译出来的内核有2.2M,有一部分烧录不正常
改用NandFlash的"Download Linux Kernel to Nand Flash"就可以了。
6.解决程序运行出现illegal instruction
每次程序运行都会突然挂起,然后报错说: Illegal instruction,百思不得其解
后来看到 中有一段话"上面的截图显示编译器默认的是支持 ARMv5T,而 TQ2440 需要使用的是 ARMv4T", 同时网上一个文章:
-
a.有了基本了解,再了解一下我们的处理器,两个处理器的架构区别:
-
S3C2410/S3C2440,是ARM920T的核心,架构指令是armv4t
-
S3C6410 ARM1176JZF-S核心,是armv6架构 :ARM11系列微处理器内核(ARM1156T2-S内核、ARM1156T2F-S内核ARM1176JZ-S内核和ARM11JZF-S内核)
-
所以如果要编译给6410使用可以改为: -march=armv6 -mcpu=arm1176jzf-s 或者
-
-march=armv6 -mcpu=arm1176jzf-s -mfloat-abi=softfp -mfpu=vfp $* (使用VFP)
-
我们可以用arm-linux-gcc --target-help命令查看编译器支持的处理器及架构
-
b. 在编译选项加上 -march=armv4t
-
CFLAGS := -Wall -O3 -march=armv4t
-
重新编译,ok
-
c. 需要注意的是,在编译和链接阶段头文件和库的路径是:
-
arm-none-linux-gnueabi/libc/armv4t/lib/
-
arm-none-linux-gnueabi/libc/usr/include/
阅读(5737) | 评论(0) | 转发(0) |