电子说
前几天编译uboot时遇到一些问题,先记录一下,linux嵌入式开发还是蛮意思的,要想玩的溜,就必须掌握最基本的uboot、kernel移植、适配、裁剪。
二 编译uboot
2.1 解压uboot源码以及交叉编译器到root目录
cd ~
tar xvf bb-black-debian-u-boot.tar.bz2
tar xf gcc-linaro-arm-linux-gnueabihf-4.8-2014.03_linux.tar.xz
2.2 安装交叉编译器
gedit /etc/profile
在最后一行加入环境变量
export PATH=$PATH:~/gcc-linaro-arm-linux-gnueabihf-4.8-2014.03_linux/bin/
使配置生效
source /etc/profile
2.3 查看版本
arm-linux-gnueabihf-gcc -v
这里会报错
bash: /...-gcc: No such file or directory
没人任何提示信息,让人摸不着头脑,搜索这个问题,发现是少了库,于是
apt-get install lib32z1
又报错了
error while loading shared libraries:
libstdc++.so.6: cannot open shared object file:
No such file or directory
这次报错倒是有提示信息,这样就简单了,安装缺少的库就可以了
apt-get install libstdc++6
apt-get install lib32stdc++6
2.4 编译uboot
cd ~
cd u-boot
make ARCH=arm CROSS_COMPILE=${CC} distclean //清理
make ARCH=arm CROSS_COMPILE=${CC} am335x_evm_config //配置
make ARCH=arm CROSS_COMPILE=${CC} //编译输
编译成功
2.5 烧录测试
2.5.1 接上串口线
2.5.2 复制镜像文件到SD卡,从SD卡启动,log如下:
U-Boot 2014.04-rc3 (Aug 17 2022 - 20:55:03)
I2C: ready
DRAM: 512 MiB
NAND: 0 MiB
MMC: OMAP SD/MMC: 0, OMAP SD/MMC: 1
*** Warning - readenv() failed, using default environment
Net: < ethaddr > not set. Validating first E-fuse MAC
cpsw, usb_ether
Warning: Your board does not use generic board. Please read
doc/README.generic-board and take action. Boards not
upgraded by the late 2014 may break or be removed.
Hit any key to stop autoboot: 0
U-Boot#
U-Boot# version
U-Boot 2014.04-rc3 (Aug 17 2022 - 20:55:03)
arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-4.8-2014.03 - Linaro GCC 2014.03) 4.8.3 20140303 (prerelease)
GNU ld (crosstool-NG linaro-1.13.1-4.8-2014.03 - Linaro GCC 2014.03) 2.24.0.20140311 Linaro 2014.03
U-Boot#
全部0条评论
快来发表一下你的评论吧 !