uboot2014.10移植(一)
最新有点时间,所以想折腾点东西,于是拿起了几年前的TQ2440玩玩,下载了uboot2014.10版本,准备移植到板子上去,没想到折腾环境都折腾了一下午。
1.工具链安装
我的工具链直接用命令安装的:
sudo apt-get install arm-linux-gnueabi
安装完之后测试下:
k@localhost ~/w/0/uboot2014.10> arm-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/arm-linux-gnueabi/5/lto-wrapper
Target: arm-linux-gnueabi
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-armel-cross/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-armel-cross --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-armel-cross --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libgcj --enable-objc-gc --enable-multiarch --enable-multilib --disable-sjlj-exceptions --with-arch=armv5t --with-float=soft --disable-werror --enable-multilib --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=arm-linux-gnueabi --program-prefix=arm-linux-gnueabi- --includedir=/usr/arm-linux-gnueabi/include
Thread model: posix
gcc version 5.4.0 20160609 (Ubuntu/Linaro 5.4.0-6ubuntu1~16.04.4)
2.修改顶层makefile:
ifeq ($(HOSTARCH),$(ARCH))
CROSS_COMPILE ?=
endif 修改成:
ifeq ($(HOSTARCH),$(ARCH))
CROSS_COMPILE ?= arm-linux-gnueabi-
endif
默认的configs文件在comfgs/目录下,于是直接运行以下命令:
k@localhost ~/w//uboot2014.> make smdk2410_defconfig
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
In file included from scripts/kconfig/zconf.tab.c:::
scripts/kconfig/menu.c: In function ‘get_symbol_str’:
scripts/kconfig/menu.c::: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized]
jump->offset = strlen(r->s);
^
scripts/kconfig/menu.c::: note: ‘jump’ was declared here
struct jump_key *jump;
^
HOSTLD scripts/kconfig/conf
#
# configuration written to .config
#
k@localhost ~/w//uboot2014.> make
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config.h
UPD include/config.h
GEN include/autoconf.mk
cc1: error: bad value (armv4) for -march= switch
/home/k/work/-uboot/uboot2014./scripts/Makefile.autoconf:: recipe for target 'include/autoconf.mk' failed
make[]: *** [include/autoconf.mk] Error
/home/k/work/-uboot/uboot2014./Makefile:: recipe for target 'silentoldconfig' failed
make[]: *** [silentoldconfig] Error
make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'. Stop.
k@localhost ~/w//uboot2014.>
猜测是ifeq那个判断不成立,所以导致工具链没有指定,所以我用下面命令执行:
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi-
也可以修改Makefile如下:
ARCH = arm
CROSS_COMPILE ?= arm-linux-gnueabi- ifeq ($(HOSTARCH),$(ARCH))
CROSS_COMPILE ?=
endif
在那个判断语句上面制定ARCH和CROSS_COMPILE,保存退出然后直接make也可以的。
这次编译没问题,但又出现include/linux/compiler-gcc.h:106:30: fatal error: linux/compiler-gcc5.h:No such file or directory的错误,原因是ubuntu的版本太高了,网上下载不到这个文件,也有人提出了其它的处理方式,我是直接执行下面命令:
k@localhost ~/w//uboot2014.> cd include/linux/
k@localhost ~/w//u/i/linux> cp compiler-gcc4.h compiler-gcc5.h
再次执行make,运行又有地方报错:
arch/arm/lib/board.c::: error: ‘coloured_LED_init’ aliased to external symbol ‘__coloured_LED_init’
void coloured_LED_init(void)__attribute__((weak, alias("__coloured_LED_init")));
^
arch/arm/lib/board.c::: error: ‘blue_led_off’ aliased to external symbol ‘__blue_led_off’
void blue_led_off(void) __attribute__((weak, alias("__blue_led_off")));
^
arch/arm/lib/board.c::: error: ‘blue_led_on’ aliased to external symbol ‘__blue_led_on’
void blue_led_on(void) __attribute__((weak, alias("__blue_led_on")));
^
arch/arm/lib/board.c::: error: ‘yellow_led_off’ aliased to external symbol ‘__yellow_led_off’
void yellow_led_off(void) __attribute__((weak, alias("__yellow_led_off")));
^
arch/arm/lib/board.c::: error: ‘yellow_led_on’ aliased to external symbol ‘__yellow_led_on’
void yellow_led_on(void) __attribute__((weak, alias("__yellow_led_on")));
^
arch/arm/lib/board.c::: error: ‘green_led_off’ aliased to external symbol ‘__green_led_off’
void green_led_off(void) __attribute__((weak, alias("__green_led_off")));
^
arch/arm/lib/board.c::: error: ‘green_led_on’ aliased to external symbol ‘__green_led_on’
void green_led_on(void) __attribute__((weak, alias("__green_led_on")));
^
arch/arm/lib/board.c::: error: ‘red_led_off’ aliased to external symbol ‘__red_led_off’
void red_led_off(void) __attribute__((weak, alias("__red_led_off")));
^
arch/arm/lib/board.c::: error: ‘red_led_on’ aliased to external symbol ‘__red_led_on’
void red_led_on(void) __attribute__((weak, alias("__red_led_on")));
^
scripts/Makefile.build:: recipe for target 'arch/arm/lib/board.o' failed
make[]: *** [arch/arm/lib/board.o] Error
Makefile:: recipe for target 'arch/arm/lib' failed
make: *** [arch/arm/lib] Error
这是因为内联函数不能为weak属性,直接将这些函数注释掉算了:
inline void __coloured_LED_init(void) {}
//void coloured_LED_init(void)__attribute__((weak, alias("__coloured_LED_init")));
inline void __red_led_on(void) {}
//void red_led_on(void) __attribute__((weak, alias("__red_led_on")));
inline void __red_led_off(void) {}
//void red_led_off(void) __attribute__((weak, alias("__red_led_off")));
inline void __green_led_on(void) {}
//void green_led_on(void) __attribute__((weak, alias("__green_led_on")));
inline void __green_led_off(void) {}
//void green_led_off(void) __attribute__((weak, alias("__green_led_off")));
inline void __yellow_led_on(void) {}
//void yellow_led_on(void) __attribute__((weak, alias("__yellow_led_on")));
inline void __yellow_led_off(void) {}
//void yellow_led_off(void) __attribute__((weak, alias("__yellow_led_off")));
inline void __blue_led_on(void) {}
//void blue_led_on(void) __attribute__((weak, alias("__blue_led_on")));
inline void __blue_led_off(void) {}
//void blue_led_off(void) __attribute__((weak, alias("__blue_led_off")));
再次make
arch/arm/lib/built-in.o: In function `clbss_l':
/home/k/work/-uboot/uboot2014./arch/arm/lib/crt0.S:: undefined reference to `coloured_LED_init'
/home/k/work/-uboot/uboot2014./arch/arm/lib/crt0.S:: undefined reference to `red_led_on'
arm-linux-gnueabi-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.26. assertion fail ../../bfd/elf32-arm.c:
arm-linux-gnueabi-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.26. assertion fail ../../bfd/elf32-arm.c:
arm-linux-gnueabi-ld.bfd: error: required section '.rel.plt' not found in the linker script
arm-linux-gnueabi-ld.bfd: final link failed: Invalid operation
Makefile:: recipe for target 'u-boot' failed
make: *** [u-boot] Error
刚才将函数注释掉了,现在当然报错了。
# bl coloured_LED_init
# bl red_led_on
直接注释掉了。
再次make,终于没问题了。
uboot2014.10移植(一)的更多相关文章
- AM335x(TQ335x)学习笔记——u-boot-2014.10移植
根据最近移植u-boot-2014.10至TQ335x,基于这样的假设am335x evm移植.不是很多地方需要改变. 因为TI的am335x evm开发了使用eeprom船上保存配置信息.它使用不同 ...
- u-boot-2012.10移植到AT91RM9200(包括NAND FLASH)
基于中嵌SRM9204 目 录 1 配置 1.1修改顶层Makefile(可选) 1.2配置 1.3下载.运行.测试 2 修改内存配置参数(根据芯片手册修改) 2.1 修改配置参数 2.2 编译 2 ...
- u-boot-2014.04移植FL2440(使用eclipse编辑uboot)
1.首先安装eclipse 安装指令 : apt-get install eclipse 使用上面的命令会安装好jdk 和eclipse,eclipse必须在Java环境执行,所以须要安装jdk环境. ...
- u-boot-2015.01在tq2440上的初步移植
作者: 彭东林 邮箱: pengdonglin137@163.com QQ: 405728433 开发板: tq2440 工具: Win7 + VMware + Debian6 ...
- tr069开源协议EasyCwmp移植
1.平台MT7628 2.交叉编译器及版本信息mipsel-linux + buildroot-gcc463_32bits.tar.bz2 3.创建工作目录lancer@ubuntu:~$ mkdir ...
- AM335x(TQ335x)学习笔记——挂载Ramdisk
上篇文章中我们已经能够通过u-boot启动内核了,但是没有能够启动成功,从内核的log中可以看出,内核启动失败的原因是没有挂载到root文件系统,本文将使用busybox制作根文件系统并打包成ramd ...
- Ubuntu16.04交叉工具链安装
前言: 开发环境是64位的ubuntu16.04,交叉工具链是通过sudo apt-get install ....安装的,移植uboot2014.10,但是很奇怪,按照网上的介绍在start.s里面 ...
- pscp使用详解 Windows与Linux文件互传工具
pscp使用详解 Windows与Linux文件互传工具 pscp使用方法详解:pscp是putty安装包所带的远程文件传输工具,是一款十分常见windows与linux系统之间文件互传的工具,使用方 ...
- u-boot ctr0.S详解 包含_main函数
/** ****************************************************************************** * @author Maox ...
随机推荐
- useful links about machine learning
机器学习(Machine Learning)&深度学习(Deep Learning)资料(Chapter 1) 机器学习(Machine Learning)&深度学习(Deep Lea ...
- Linux系统管理常用命令用法总结(1)
1.usermod可用来修改用户帐号的各项设定. usermod [-LU][-c <备注>][-d <登入目录>][-e <有效期限>][-f <缓冲天数& ...
- 1080 MOOC期终成绩
对于在中国大学MOOC(http://www.icourse163.org/ )学习“数据结构”课程的学生,想要获得一张合格证书,必须首先获得不少于200分的在线编程作业分,然后总评获得不少于60分( ...
- 1076 Wifi密码
下面是微博上流传的一张照片:“各位亲爱的同学们,鉴于大家有时需要使用 wifi,又怕耽误亲们的学习,现将 wifi 密码设置为下列数学题答案:A-1:B-2:C-3:D-4:请同学们自己作答,每两日一 ...
- netty源码理解(二) serverstrap.bind()
eventloop是一个线程,里面有一个executor封装了一个线程工厂,在启动的时候启动一个线程,传入的实现了runnable的内部类,里面调用了eventloop的run方法.
- Oracle非归档模式下脱机数据文件
正常情况下,要想对数据文件脱机,必须在归档模式下,这是ORACLE自动保护的一种措施,防止在非归档模式下对数据文件脱机,造成数据丢失.如果想在非归档模式下执行数据文件脱机操作,则需要加上“for dr ...
- 解决At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs
在写spring security小程序时遇到 At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug l ...
- base64encode 编码原理
Base64编码,是我们程序开发中经常使用到的编码方法.它是一种基于用64个可打印字符来表示二进制数据的表示方法.它通常用作存储.传输一些二进制数据编码方法!也是MIME(多用途互联网邮件扩展,主要用 ...
- python 常用的高阶函数
前言 高阶函数指的是能接收函数作为参数的函数或类:python中有一些内置的高阶函数,在某些场合使用可以提高代码的效率. map() map函数可以把一个迭代对象转换成另一个可迭代对象,不过在pyth ...
- NAVICAT for 32位/64位 及破解工具PatchNavicat
Navicat提供多达 7 种语言供客户选择,被公认为全球最受欢迎的数据库前端用户介面工具. 它可以用来对本机或远程的 MySQL.SQL Server.SQLite.Oracle 及 Postgre ...