荔枝派licheepi_nano编译uboot记录

板子使用我自己重新绘制的f1c100s,开源地址:复刻f1c100s/f1c200sLinux - 嘉立创EDA开源硬件平台

首先完全参照官网给的教程来前言 - Sipeed Wiki

注意选择相应的板子,安装合适的交叉编译器,我之前安装的交叉编译器是4.9版本的,编译过程报错,提示编译器版本过低

参考官网直接下载相应的交叉编译器,然后添加到环境变量中就行。如果arm-linux-gnueabi-gcc -v显示的交叉编译器版本没有改变,可以试试把老编译器的文件夹名字改了,然后把新版本的添加到老文件夹中(我也不知道是否有更好的方法)。

然后编译,报错error: command 'swig' failed: No such file or directory

 直接sudo apt install swig即可

然后又报错/usr/bin/ld: scripts/dtc/dtc-parser.tab.o:(.bss+0x10): multiple definition of `yylloc'; scripts/dtc/dtc-lexer.lex.o:(.bss+0x0): first defined here

 参考【编译错误】multiple definition of `yylloc`_小勇者的博客-CSDN博客

我是直接改的源码中的变量

然后又又又报错了Error: arch/arm/dts/.suniv-f1c100s-licheepi-nano.dtb.pre.tmp:59.1-10 syntax error
FATAL ERROR: Unable to parse input tree

 参考编译U-Boot DTB 时报错 syntax error; FATAL ERROR: Unable to parse input tree | 柚木鉉の空間 GloomyGhost Blog

把多余的反斜杠删掉即可

然后叕报错/usr/bin/env: “python2”: 没有那个文件或目录

 我是把原系统自带的2.7连接到python2,或者直接

sudo apt install python2-minimal

 然后叒双报错

参考 【问题解决】报错:ImportError: No module named _libfdt_JavonPeng的博客-CSDN博客

然后叕双报错scripts/dtc/pylibfdt/libfdt_wrap.c:168:11: fatal error: Python.h: 没有那个文件或目录
  168 | # include <Python.h>

 参考fatal error: Python.h: 没有那个文件或目录 解决方法_我的狗叫乐乐八岁了的博客-CSDN博客

我安装的

sudo apt install python2-dev

最后经历多波多折后终于编译成功了

 然后下载官方的工具

git clone -b f1c100s-spiflash https://gitee.com/sunnyczh1/sunxi-tools.git

https://gitee.com/sunnyczh1/sunxi-tools.git

编译报错fel_lib.c:26:10: fatal error: libusb.h: 没有那个文件或目录
   26 | #include <libusb.h>
      |          ^~~~~~~~~~
compilation terminated.
make: *** [Makefile:142:sunxi-fel] 错误 1
https://gitee.com/sunnyczh1/sunxi-tools.git

 参考官方安装

sudo apt-get install libusb-1.0-0-dev

 但依旧报错,

看前一句报错,安装pkg-config即可

sudo apt-get install pkg-config

猜你喜欢

转载自blog.csdn.net/hhcgn/article/details/131794048