[I.MX6UL] U-Boot移植(一)

uboot 官网为 :ftp://ftp.denx.de/pub/u-boot/
NXP 的uboot:https://cloud.189.cn/t/yInEfqMV7Jru

首先需要安装支持。
终端输入:sudo apt-get install libncurses5-dev
mkdir /home/xue1995/linux/uboot
cd /home/xue1995/linux/uboot/

将NXP 的uboot放入/uboot/文件夹中,并解压。

cd /uboot-imx-rel_imx_4.1.15_2.1.0_ga
tar -vxjf uboot-imx-rel_imx_4.1.15_2.1.0_ga.tar.bz2

解压完毕后,编译配置文件。

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mx6ull_14x14_evk_emmc_defconfig
make V=1 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16

在这里插入图片描述
在这里插入图片描述

直接在顶层 Makefile 中直接给 ARCH 和CORSS_COMPILE 赋值,修改如图所示:
终端输入:sudo gedit Makefile
在这里插入图片描述

ARCH=arm
CROSS_COMPILE=arm-linux-gnueabihf-

这样就可以使用简短的命令来编译 uboot :

make mx6ull_14x14_evk_emmc_defconfig
make V=1 -j16

如果既不想修改 uboot 的顶层 Makefile,又想编译的时候不用输入那么多,那么就直接创建个 shell 脚本就行了,shell 脚本名为 mx6ull_14x14_emmc.sh,然后在 shell 脚本里面输入如下内容:
终端输入:sudo gedit mx6ull_14x14_emmc.sh
内容:

#!/bin/bash 
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean 
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- 
mx6ull_14x14_evk_emmc_defconfig 
make V=1 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j16 

编译的时候直接执行这个脚本就行了,命令如下:./mx6ull_14x14_evk_emmc.sh
编译完成以后会生成 u-boot.bin、u-boot.imx 等文件,但是这些文件是 NXP 官方 I.MX6ULLEVK 开发板。

烧写验证与驱动测试

imxdownload下载:https://cloud.189.cn/t/mM7rIveUfiYz
将 imxdownload 软件拷贝到 uboot 源码根目录下,然后使用 imxdownload 软件将 u-boot.bin烧写到 SD 卡中,烧写命令如下:

chmod 777 imxdownload  
//给予 imxdownload 可执行权限  

./imxdownload u-boot.bin /dev/sdg
//烧写 u-boot.bin 到 SD 卡中

烧写完成以后将 SD 卡插入 I.MX6U-ALPHA 开发板的 TF 卡槽中,最后设置开发板从 SD
卡启动。打开 SecureCRT,设置好开发板所使用的串口并打开,复位开发板,SecureCRT 接收到
如下图 所示信息:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_29246181/article/details/106240055