Uboot在2410板子上移植
来源:互联网 发布:数据字典的主要作用 编辑:程序博客网 时间:2024/05/16 00:24
1.环境
uboot版本:u-boot-1.1.4
交叉编译器(CROSS-COMPILE)版本:2.95.3
操作系统:Fedora 6
2.步骤
为开发板取名crane2410, 并在u-boot中建立自己的开发板类型
2.1修改Makefile
[uboot@localhost u-boot-1.1.4]$ vi Makefile
#为crane2410建立编译项
crane2410_config : unconfig
@./mkconfig $(@:_config=) arm arm920t crane2410 NULL s3c24x0
各项的意思如下:
arm: CPU的架构(ARCH)
arm920t: CPU的类型(CPU),其对应于cpu/arm920t子目录。
crane2410: 开发板的型号(BOARD),对应于board/crane2410目录。
NULL: 开发者/或经销商(vender)。
s3c24x0: 片上系统(SOC)。
2.2 在board子目录中建立crane2410
[uboot@localhost uboot]#cp rf
board/smdk2410 board/crane2410
[uboot@localhost uboot]#cd board/crane2410
[uboot@localhost crane2410]#mv smdk2410.c crane2410.c
2.3 在include/configs/中建立配置头文件
[uboot@localhost crane2410]#cd ../..
[uboot@localhost uboot]#cp include/configs/smdk2410.h include/configs/crane2410.h
2.4 指定交叉编译工具的路径
[uboot@localhost uboot]#vi ~/.bashrc
export PATH=/usr/local/arm/2.95.3/bin:$PATH
2.5 测试编译能否成功
[uboot@localhost uboot]#make crane2410_config
[uboot@localhost uboot]#make CROSS_COMPILE=arm-linux
若编译成功,则应该在uboot目录下生成u-boot.bin文件,将其烧写到2410板卡里应该能够启动。
常见错误:
1. 在make的过程中,出现:cc1: invalid option `abi=apcs-gnu'
解决方法:
出错的文件是/cpu/s3c44b0/下的config.mk:将
PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
改成:
PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,$(call cc-option,-mabi=apcs-gnu),)
2. 修改了第一个错误后,继续make,出现了如下的报错:
make[1]: *** No rule to make target `hello_world.srec', needed by `all'. Stop.
make[1]: Leaving directory `/home/mort/src/targa/u-boot/u-boot-TOT/examples'
make: *** [examples] Error 2
解决方法:
修改examples/Makefile
把126行和129行改为:
%.srec: %.o
%.bin: %.o
继续make
3. 出现 crane2410.a needed by smdk2410.o
解决方法:
修改board/crane2410/Makefile
将28行的
OBJS := smdk2410.o flash.o
改为
OBJS := crane2410.o flash.o
继续make
uboot版本:u-boot-1.1.4
交叉编译器(CROSS-COMPILE)版本:2.95.3
操作系统:Fedora 6
2.步骤
为开发板取名crane2410, 并在u-boot中建立自己的开发板类型
2.1修改Makefile
[uboot@localhost u-boot-1.1.4]$ vi Makefile
#为crane2410建立编译项
crane2410_config : unconfig
@./mkconfig $(@:_config=) arm arm920t crane2410 NULL s3c24x0
各项的意思如下:
arm: CPU的架构(ARCH)
arm920t: CPU的类型(CPU),其对应于cpu/arm920t子目录。
crane2410: 开发板的型号(BOARD),对应于board/crane2410目录。
NULL: 开发者/或经销商(vender)。
s3c24x0: 片上系统(SOC)。
2.2 在board子目录中建立crane2410
[uboot@localhost uboot]#cp rf
board/smdk2410 board/crane2410
[uboot@localhost uboot]#cd board/crane2410
[uboot@localhost crane2410]#mv smdk2410.c crane2410.c
2.3 在include/configs/中建立配置头文件
[uboot@localhost crane2410]#cd ../..
[uboot@localhost uboot]#cp include/configs/smdk2410.h include/configs/crane2410.h
2.4 指定交叉编译工具的路径
[uboot@localhost uboot]#vi ~/.bashrc
export PATH=/usr/local/arm/2.95.3/bin:$PATH
2.5 测试编译能否成功
[uboot@localhost uboot]#make crane2410_config
[uboot@localhost uboot]#make CROSS_COMPILE=arm-linux
若编译成功,则应该在uboot目录下生成u-boot.bin文件,将其烧写到2410板卡里应该能够启动。
常见错误:
1. 在make的过程中,出现:cc1: invalid option `abi=apcs-gnu'
解决方法:
出错的文件是/cpu/s3c44b0/下的config.mk:将
PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,-mabi=apcs-gnu)
改成:
PLATFORM_CPPFLAGS +=$(call cc-option,-mapcs-32,$(call cc-option,-mabi=apcs-gnu),)
2. 修改了第一个错误后,继续make,出现了如下的报错:
make[1]: *** No rule to make target `hello_world.srec', needed by `all'. Stop.
make[1]: Leaving directory `/home/mort/src/targa/u-boot/u-boot-TOT/examples'
make: *** [examples] Error 2
解决方法:
修改examples/Makefile
把126行和129行改为:
%.srec: %.o
%.bin: %.o
继续make
3. 出现 crane2410.a needed by smdk2410.o
解决方法:
修改board/crane2410/Makefile
将28行的
OBJS := smdk2410.o flash.o
改为
OBJS := crane2410.o flash.o
继续make
4. 将编译好的u-boot.bin烧写到2410板卡里,启动,通过串口打印消息,虽然能够启动到u-boot的命令行,但有错:U-Boot 1.1.4 (Mar 7 2007 - 11:15:21)
U-Boot code: 33F80000 -> 33F9873C BSS: -> 33F9C814
RAM Configuration:
Bank #0: 30000000 64 MB
Flash: 512 kB
*** Warning - bad CRC, using default environment
RAM Configuration:
Bank #0: 30000000 64 MB
Flash: 512 kB
*** Warning - bad CRC, using default environment
In: serial
Out: serial
Err: serial
SMDK2410 #
Out: serial
Err: serial
SMDK2410 #
解决方法:
通过分析u-boot的启动流程,调试代码,得知问题出在cpu/at91rm9200/start.S中。其中有一段代码:
--------------------
ldr r0, =_start
ldr r1, =0x0
mov r2, #16
copyex:
subs r2, r2, #1
ldr r3, [r0], #4
str r3, [r1], #4
bne copyex
ldr r1, =0x0
mov r2, #16
copyex:
subs r2, r2, #1
ldr r3, [r0], #4
str r3, [r1], #4
bne copyex
--------------------
它的作用是把中断向量表从flash reload到RAM,以提高速度。但是它没有进行remap。故而使得u-boot启动之后无法寻找到环境变量所在的第63扇区。更改如下:
--------------------
if 0
ldr r0, =_start
ldr r1, =0x0
mov r2, #16
copyex:
subs r2, r2, #1
ldr r3, [r0], #4
str r3, [r1], #4
bne copyex
ldr r1, =0x0
mov r2, #16
copyex:
subs r2, r2, #1
ldr r3, [r0], #4
str r3, [r1], #4
bne copyex
endif
--------------------
即把此段代码注释掉。
【或者是在此段前面加上remap部分,不过如果加上remap,则需要把前面的设置svc部分的代码注释掉,否则在u-boot>reset时会进入异常状态。】
此解决方案对u-boot-1.1.1也有效。
以上是本人在移植u-boot中遇到的问题,和上网得到的解决方法。
参考资料有:
1.linux系统移植: linux_mig_release_G4oyxcsIVyIZ.pdf
2. http://www.ednchina.com/blog/seabiscuit/11759/category.aspx
- Uboot在2410板子上移植
- Uboot在2410板子上移植(转)
- uboot在2410上的移植
- 移植uboot第一步:下载,编译,烧到板子上试验
- PHP在arm板子上的移植
- qt在嵌入式板子上的移植
- uboot在2440上移植
- uboot在2440上移植
- uboot在2440上移植
- u-boot在华恒S3C2410EDU板子上的移植
- Uboot在不同平台上的移植
- uboot 在 ARM s3c2410 上移植过程
- uboot 在 ARM s3c2410 上移植过程
- uboot 在 ARM s3c2410 上移植过程
- uboot 在 ARM s3c2410 上移植过程
- uboot 在 ARM s3c2410 上移植过程
- uboot 在utu2440上的移植
- uboot在utut2440上的移植
- FlashFXP 3.4.2 Beta
- 程序员之道
- 面膜
- 手动实现Vector
- 什么是CMS系统?
- Uboot在2410板子上移植
- ASP.NET2.0里web.config配置的读写
- 转贴:将log4net日志记录到数据库中
- [Tool]判断用户输入是否符合规范(大小写0~9数字)
- [Tool]纯代码绘制提示框
- d-Left Hashing
- 美容DIY
- jdbc - oracle
- Adodb.Stream 组件的使用说明