u-boot编译错误1:dtc: not found make

本文介绍了使用NanoPC-T3_plus开发板在Ubuntu20.04环境下编译U-Bootv2016.01的过程。文章详细记录了从克隆源代码到解决编译错误直至成功编译的步骤,并提供了编译后的文件清单。

1.相关资料及开发环境

开发板:NanoPC-T3_plus

OS:Ubuntu20.04

参考资料:https://wiki.friendlyarm.com/wiki/index.php/NanoPC-T3_Plus/zh

2.编译U-Boot

     根据参考资料,用git克隆了U-Boot v2016.01源代码,切换到nanopi2-v2016.01分支。进入u-boot编译,过程如下:

#克隆u-boot仓库
git clone https://github.com/friendlyarm/u-boot.git 

#切换分支
cd u-boot git checkout nanopi2-v2016.01 

#编译配置
make s5p6818_nanopi3_defconfig

#用交叉编译器进行4线程编译
make -j4 CROSS_COMPILE=aarch64-linux-

3.编译错误

    在编译过程中产生如下如下错误:

/bin/sh: 1: dtc: not found
make[2]: *** [scripts/Makefile.lib:296: arch/arm/dts/s5p6818-drone.dtb] Error 127
make[1]: *** [dts/Makefile:36: arch-dtbs] Error 2
make: *** [Makefile:1249: dts] Error 2

4.错误原因

    uboot编译需要dtc相关命令的支持

    dtcdevice-tree-compiler的缩写,即设备树编译器,说明系统中没有安装这个编译器

5.解决方案

    安装设备树编译器即可

sudo apt-get install device-tree-compiler

6.编译结果

编译前:

fyywhy@CTO:/work/nanopc-t3-plus/u-boot$ ls
api     config.mk  drivers   include  Licenses     net      snapshot.commit
arch    configs    dts       Kbuild   MAINTAINERS  post     test
board   disk       examples  Kconfig  MAKEALL      README   tools
common  doc        fs        lib      Makefile     scripts

编译后:

fyywhy@CTO:/work/nanopc-t3-plus/u-boot$ ls
api        drivers            Kconfig      README           u-boot.cfg
arch       dts                lib          scripts          u-boot.lds
board      examples           Licenses     snapshot.commit  u-boot.map
common     fip-nonsecure.bin  MAINTAINERS  System.map       u-boot.srec
config.mk  fip-nonsecure.img  MAKEALL      test
configs    fs                 Makefile     tools
disk       include            net          u-boot
doc        Kbuild             post         u-boot.bin

编译成功,得到fip-nonsecure.img,可以通过fastboot、sd-fuse_s5p6818和eflasher ROM来更新板上的U-Boot v2016.01。

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值