【Linux系统移植】NXP 官方开发板 uboot 编译与烧录

编程入门 行业动态 更新时间:2024-10-16 18:27:20

【Linux系统移植】NXP 官方开发板 uboot 编译与<a href=https://www.elefans.com/category/jswz/34/1769777.html style=烧录"/>

【Linux系统移植】NXP 官方开发板 uboot 编译与烧录

U-Boot官网

1、下载NXP 官方 I.MX6ULL EVK 开发板的uboot :

uboot-imx-rel_imx_4.1.15_2.1.0_ga.tar.bz2

 

2、解压进入 uboot 文件夹

tar -xjvf uboot-imx-rel_imx_4.1.15_2.1.0_ga.tar.bz2&&cd uboot-imx-rel_imx_4.1.15_2.1.0_ga

解压出来的文件:

 

3、编译uboot

方法一:直接命令编译

//清除
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- -j12

编译完成:

编译后的文件:

uboot-imx-rel_imx_4.1.15_2.1.0_ga/configs 文件夹  mx6ull_14x14_evk_emmc_defconfig 的内容:

CONFIG_SYS_EXTRA_OPTIONS="IMX_CONFIG=board/freescale/mx6ullevk/imximage.cfg"
CONFIG_ARM=y
CONFIG_ARCH_MX6=y
CONFIG_TARGET_MX6ULL_14X14_EVK=y
CONFIG_CMD_GPIO=y

 

方法二:修改顶层Makefile,给 ARCH 和 CROSS_COMPILE 赋值

(1)vim编辑器打开Makefile,输入 248+ 跳转到248行,添加以下内容。

vim Makefile
ARCH  ?= arm 
CROSS_COMPILE ?= arm-linux-gnueabihf-

(2)使用以下命令清除和编译

make distclean
make mx6ull_14x14_evk_emmc_defconfig
make V=1 -j12

 

方法三:使用 shell 脚本编译
(1)新建mx6ull_iot_emmc.sh 的 shell 脚本文件

vim mx6ull_iot_emmc.sh

(2)写入以下内容。shell 脚本要求第一行必须是“#!/bin/bash”或者“#!/bin/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- -j12

(2)给脚本文件可执行权限

chmod 777 mx6ull_iot_emmc.sh

(3)执行脚本文件

./mx6ull_iot_emmc.sh

 

编译遇到的错误:

cc1: error: bad value (armv5) for -march= switch
Makefile:927: recipe for target 'u-boot.cfg' failed
make: *** [u-boot.cfg] Error 1

解决:看是否赋值时写错了字母
 

4、使用SD卡烧录与测试uboot

IMX6ULL的 U-Boot 与裸机SD卡烧写与启动

启动后串口终端输出:

 

 

更多推荐

【Linux系统移植】NXP 官方开发板 uboot 编译与烧录

本文发布于:2024-02-10 21:45:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1677457.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:烧录   开发板   官方   系统   Linux

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!