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/0/uboot2014.10> make smdk2410_defconfigHOSTCC scripts/basic/fixdepHOSTCC scripts/kconfig/conf.oSHIPPED scripts/kconfig/zconf.tab.cSHIPPED scripts/kconfig/zconf.lex.cSHIPPED scripts/kconfig/zconf.hash.cHOSTCC scripts/kconfig/zconf.tab.o In file included from scripts/kconfig/zconf.tab.c:2537:0: scripts/kconfig/menu.c: In function ‘get_symbol_str’: scripts/kconfig/menu.c:590:18: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized]jump->offset = strlen(r->s);^ scripts/kconfig/menu.c:551:19: note: ‘jump’ was declared herestruct jump_key *jump;^HOSTLD scripts/kconfig/conf # # configuration written to .config # k@localhost ~/w/0/uboot2014.10> make scripts/kconfig/conf --silentoldconfig KconfigCHK include/config.hUPD include/config.hGEN include/autoconf.mk cc1: error: bad value (armv4) for -march= switch /home/k/work/02-uboot/uboot2014.10/scripts/Makefile.autoconf:64: recipe for target 'include/autoconf.mk' failed make[2]: *** [include/autoconf.mk] Error 1 /home/k/work/02-uboot/uboot2014.10/Makefile:466: recipe for target 'silentoldconfig' failed make[1]: *** [silentoldconfig] Error 1 make: *** No rule to make target 'include/config/auto.conf', needed by 'include/config/uboot.release'. Stop. k@localhost ~/w/0/uboot2014.10>
猜测是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/0/uboot2014.10> cd include/linux/ k@localhost ~/w/0/u/i/linux> cp compiler-gcc4.h compiler-gcc5.h
再次执行make,运行又有地方报错:
arch/arm/lib/board.c:67:6: 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:83:6: 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:81:6: 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:79:6: 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:77:6: 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:75:6: 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:73:6: 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:71:6: 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:69:6: 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:275: recipe for target 'arch/arm/lib/board.o' failed make[1]: *** [arch/arm/lib/board.o] Error 1 Makefile:1037: recipe for target 'arch/arm/lib' failed make: *** [arch/arm/lib] Error 2
这是因为内联函数不能为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/02-uboot/uboot2014.10/arch/arm/lib/crt0.S:122: undefined reference to `coloured_LED_init' /home/k/work/02-uboot/uboot2014.10/arch/arm/lib/crt0.S:123: undefined reference to `red_led_on' arm-linux-gnueabi-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.26.1 assertion fail ../../bfd/elf32-arm.c:8472 arm-linux-gnueabi-ld.bfd: BFD (GNU Binutils for Ubuntu) 2.26.1 assertion fail ../../bfd/elf32-arm.c:8472 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:1019: recipe for target 'u-boot' failed make: *** [u-boot] Error 1
刚才将函数注释掉了,现在当然报错了。
# bl coloured_LED_init # bl red_led_on
直接注释掉了。
再次make,终于没问题了。
转载于:https://www.cnblogs.com/kent-hu/p/7711311.html
uboot2014.10移植(一)相关推荐
- AM335x(TQ335x)学习笔记——u-boot-2014.10移植
最近移植了下u-boot-2014.10到TQ335x,如果基于am335x evm进行移植,需要修改的地方并不多. 由于TI的am335x evm开发使用了一个eeprom保存了板载配置信息,用来区 ...
- u-boot-2014.10移植第3天----LED裸机程序
硬件平台:tq2440 开发环境:Ubuntu-3.11 u-boot版本:2014.10 本文允许转载,请注明出处:http://blog.csdn.net/fulinus 在移植u-boot之前我 ...
- u-boot-2014.10移植第29天----nand flash的SPL启动(一)
硬件平台:tq2440 开发环境:Ubuntu-3.11 u-boot版本:2014.10 本文允许转载,请注明出处:http://blog.csdn.net/fulinus 前面在移植nand fl ...
- u-boot-2014.10移植第18天----添加DM9000网卡支持(二)
硬件平台:tq2440 开发环境:Ubuntu-3.11 u-boot版本:2014.10 本文允许转载,请注明出处:http://blog.csdn.net/fulinus 修改代码 一不小心把这篇 ...
- u-boot-2014.10移植第7天----深入分析代码(二)
硬件平台:tq2440 开发环境:Ubuntu-3.11 u-boot版本:2014.10 本文允许转载,请注明出处:http://blog.csdn.net/fulinus 现在从代码的角度来分析启 ...
- u-boot-2014.10移植第25天----nand flash启动(三)
硬件平台:tq2440 开发环境:Ubuntu-3.11 u-boot版本:2014.10 本文允许转载,请注明出处:http://blog.csdn.net/fulinus 在实现u-boot从na ...
- u-boot-2014.10移植第14天----在SDRAM中运行
硬件平台:tq2440 开发环境:Ubuntu-3.11 u-boot版本:2014.10 本文允许转载,请注明出处:http://blog.csdn.net/fulinus 昨天遇到编译错误,我们从 ...
- u-boot-2012.10移植(三)MMC驱动
上期通过三星Internal ROM Application Note提供了启动设备的复制函数,实现了u-boot从sd卡启动.本期完成MMC驱动的移植. 1. 代码修改 1.1 修改include/ ...
- moveit配置机械臂(zhuan zai)
一.准备模型 下载地址:https://download.csdn.net/download/weixin_37663721/36066113 二.初始化机械臂 0.启动moveit初始化助手 ros ...
最新文章
- Golang sync
- python做软件-用python做个翻译小软件吧~
- 【科技金融】互金风控大数据盘点
- 字体大宝库:设计师必备的专业免费英文字体
- 并发之线程封闭与ThreadLocal解析
- Stellarium Windows/Linux编译记录
- node-webkit(Windows系统) 打包成exe文件后,被360杀毒软件误报木马的解决方法
- python人物出场统计实例_实例2之《三国演义》人物出场统计
- 基于C的VAD实现一
- 首款国产8K 50P小型化广播级摄像机惊喜亮相冬季冰雪体育盛会
- 面向对象和面向过程的区别通俗理解
- 企业邮箱支持通过手机号登录邮箱
- 计算机考研 | 2020我计算机考研为什么会失败+复盘(备战2022)
- 阿里云OSS服务器上传图片并获取路径(SpringBoot)(☆)
- python实现labelme样本自动标注
- HDU 2075 JAVA
- php懒人,关于php懒人函数的详细介绍
- 广东二本计算机专业大学排名及分数线,2021年广东二本大学排名及分数线(完整版)...
- 爬取天气数据进行绘制折线图
- VS2013在MFC中使用ADO方法操作Access2013数据库
热门文章
- 【论文写作分析】之三《基于预训练语言模型的案件要素识别方法》
- Repeater 使用小技巧 内部radio 横排
- oracle闪回 分区,Oracle 闪回区(Oracle Flash recovery area)
- c#语言编写汉诺塔游戏,c#实现汉诺塔问题示例
- docker部署minio
- 295. 数据流的中位数
- 2020-09-22C++学习笔记之引用1(1.引用(普通引用)2.引用做函数参数 3.引用的意义 4.引用本质5.引用结论 6.函数返回值是引用(引用当左值)7测试代码)
- java 必备_Java基础必备
- 群同态基本定理证明_近世代数(3)——群的基本性质
- Python * ** 打包解包详解