鄙人,花了三天用来移植uboot到FL2440更换过各种版本的uboot和交叉编译器最终在arm-linux-gcc 4.4.3版本和uboot-1.3.4版本的情况先移植成功。
先面介绍一下我遇到的各种错误及解决方案:
错误一:
main.c:51:error:inline function 'show_boot_progress' cannot bedecleared weak
make[1]:***[main.0]错误1
make[1]:正在离开目录'/home/sns/linux2.6.32/icetek-v3/u-boot-orig/common'
make:***[common/libcommon.a]错误2
解决方法:去掉show_boot_progress 前面的inline即可
错误二:
board.c:127: error: inline function 'coloured_LED_init' cannotbe declared weak
board.c:129: error: inline function 'red_LED_on' cannot be declaredweak
board.c:131: error: inline function 'red_LED_off' cannot bedeclared weak
board.c:133: error: inline function 'green_LED_on' cannot bedeclared weak
board.c:135: error: inline function 'green_LED_off' cannot bedeclared weak
board.c:137: error: inline function 'yellow_LED_on' cannot bedeclared weak
board.c:139: error: inline function 'yellow_LED_off' cannot bedeclared weak
board.c:141: error: inline function 'blue_LED_on' cannot bedeclared weak
board.c:143: error: inline function 'blue_LED_off' cannot bedeclared weak
make[1]: *** [board.o] 错误 1
make[1]: Leaving directory`/root/workspace/u-boot-2009.08/lib_arm'
make: *** [lib_arm/libarm.a] 错误 2
解决方法:
打开lib_arm/board.c,定位到127行开始,将其注释掉:
void inline __coloured_LED_init (void){}
//void inline coloured_LED_init (void) __attribute__((weak,alias("__coloured_LED_init")));
这里注释掉了'coloured_LED_init' 的部分,自己做时对照注释掉后面几个带__attribute__的部分即可
错误三:cpu/arm920t/start.o: In function`start_code':
/root/workspace/u-boot-2009.08/cpu/arm920t/start.S:117: undefinedreference to `coloured_LED_init'
/root/workspace/u-boot-2009.08/cpu/arm920t/start.S:118: undefinedreference to `red_LED_on'
make: *** [u-boot] 错误 1
解决方法:
打开cpu/arm920t/start.S,搜索“coloured_LED_init”定位到117行,找到如下代码:
bl coloured_LED_init
bl red_LED_on
这两行是AT91RM9200DK开发板的LED初始化,注释掉即可。
错误四: MINI2440.c:In function 'board_init':
MINI2440.c:101:error‘S3C24X0_GPIO’ has no member named 'GPACON'
MINI2440.c:102:error‘S3C24X0_GPIO’ has no member named 'GPACON'
MINI2440.c:103‘S3C24X0_GPIO’has no member named 'GPACON'
......
解决方法:进入include/,编辑s3c24x0.h文件的407行,将#ifdef CONFIG_S3C2410改为#ifdefCONFIG_S3C2440。
五:warning: target CPU does not support interworking
解决:一看就知道是跟CPU有关,到u-boot根目录下执行
$sudo gedit "cpu/arm920t/config.mk"
把 PLATFORM_CPPFLAGS += -march=armv4 改成 PLATFORM_CPPFLAGS += -march=armv4t
六:uboot软浮点错误
问题:
opt/crosstool/gcc-4.1.0-glibc-2.3.2/arm-linux/lib/gcc/arm-linux/4.1.0 -lgcc \
-Map u-boot.map -o u-boot
arm-linux-ld: ERROR: /opt/crosstool/gcc-4.1.0-glibc-2.3.2/arm-linux/lib/gcc/arm-linux/4.1.0/libgcc.a(_udivdi3.o) uses hardware FP, whereas u-boot uses software FP
arm-linux-ld: failed to merge target specific data of file /opt/crosstool/gcc-4.1.0-glibc-2.3.2/arm-linux/lib/gcc/arm-linux/4.1.0/libgcc.a(_udivdi3.o)
arm-linux-ld: ERROR: /opt/crosstool/gcc-4.1.0-glibc-2.3.2/arm-linux/lib/gcc/arm-linux/4.1.0/libgcc.a(_clz.o) uses hardware FP, whereas u-boot uses software FP
arm-linux-ld: failed to merge target specific data of file /opt/crosstool/gcc-4.1.0-glibc-2.3.2/arm-linux/lib/gcc/arm-linux/4.1.0/libgcc.a(_clz.o)
make: *** [u-boot] 错误 1