编译器下载地址:Downloads | GNU-A Downloads – Arm Developer[1]
当前最新版本 v2023.04-rc2 下载地址:https://github.com/u-boot/u-boot/archive/refs/tags/v2023.04-rc2.tar.gz[2]
设置交叉编译器:
export CROSS_COMPILE=arm-none-linux-gnueabihf-
编译配置:
make nanopi_neo_defconfig
编译:
make -j8
遇到问题:
解决:
sudo apt install python3-pip
pip3 install setuptools
编译产物:
烧录:
sudo dd if=u-boot-sunxi-with-spl.bin of=/dev/sdc bs=1024 seek=8 oflag=direct
启动测试:
根据启动打印信息可以看到 DDR 大小是对的,相较于 NanoPi 提供镜像中 uboot,多了对网络的支持。
查看 SD 卡是否正常识别到:
查看网卡信息:
给网卡设置 ip 地址:
setenv ipaddr 192.168.0.110
setenv gatewayip 192.168.0.1
setenv netmask 255.255.255.0
saveenv
测试网络通信,正常:
这下就方便多了,可以在 pc 上搭 TFTP 服务,然后使用 uboot 通过 tftp 拉取内核和设备树启动,不过本文还是使用 SD 卡启动方式,有兴趣的读者可以看我 imx6ull 的文章。
当前 stable 版本 6.1.11 下载地址:https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.1.11.tar.xz[3]
设置交叉编译器:
export ARCH=arm
export CROSS_COMPILE=arm-none-linux-gnueabihf-
编译配置:
make sunxi_defconfig
编译:
make -j16
编译产物:
替换原有 sd 卡第一个 boot 分区的 zImage 镜像和设备树文件。
sudo mount /dev/sdb1 /mnt
sudo cp arch/arm/boot/zImage /mnt/zImage
sudo cp arch/arm/boot/dts/sun8i-h3-nanopi-neo.dtb /mnt/sun8i-h3-nanopi-neo.dtb
sync
sudo umount /mnt
将 sd 卡插入到开发板重新启动,进入 uboot 命令行,直接拉取内核启动:
fatload mmc 0 0x46000000 zImage
fatload mmc 0 0x48000000 sun8i-h3-nanopi-neo.dtb
setenv bootargs "console=ttyS0,115200 earlyprintk root=/dev/mmcblk0p2 rootfstype=ext4 rw rootwait"
bootz 0x46000000 - 0x48000000
rootfs 使用基于 ubuntu20.04 移植的:i.MX6ULL 系统移植 | 基于 ubuntu base 20.04 构建根文件系统
内核版本:
发行版版本:
CPU 信息:
网络正常:
[1]
Downloads | GNU-A Downloads – Arm Developer: https://developer.arm.com/downloads/-/gnu-a
[2]
https://github.com/u-boot/u-boot/archive/refs/tags/v2023.04-rc2.tar.gz: https://github.com/u-boot/u-boot/archive/refs/tags/v2023.04-rc2.tar.gz
[3]
https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.1.11.tar.xz: https://cdn.kernel.org/pub/linux/kernel/v6.x/linux-6.1.11.tar.xz
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有