正点原子uboot初始

2021/11/2 23:15:23

本文主要是介绍正点原子uboot初始,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

tar -xvjf uboot-imx-2016.03-2.1.0-gd3f0479-v1.4.tar.bz2
ubuntu@ubuntu-vpc:~/桌面/uboot$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean
  CLEAN   examples/standalone
  CLEAN   tools
  CLEAN   tools/lib tools/common
  CLEAN   u-boot-nodtb.bin u-boot.lds u-boot.map u-boot.cfg u-boot.srec u-boot u-boot.sym System.map
  CLEAN   scripts/basic
  CLEAN   scripts/kconfig
  CLEAN   include/config include/generated
  CLEAN   include/autoconf.mk include/autoconf.mk.dep include/config.h
ubuntu@ubuntu-vpc:~/桌面/uboot$ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mx6ull_14x14_ddr512_emmc_defconfig
  HOSTCC  scripts/basic/fixdep
  HOSTCC  scripts/kconfig/conf.o
  SHIPPED scripts/kconfig/zconf.tab.c
  SHIPPED scripts/kconfig/zconf.lex.c
  SHIPPED scripts/kconfig/zconf.hash.c
  HOSTCC  scripts/kconfig/zconf.tab.o
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
ubuntu@ubuntu-vpc:~/桌面/uboot$ make V=1 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j12
....
....
....
Image Type:   Freescale IMX Boot Image
Image Ver:    2 (i.MX53/6/7 compatible)
Mode:         DCD
Data Size:    385024 Bytes = 376.00 kB = 0.37 MB
Load Address: 877ff420
Entry Point:  87800000
  1. ARCH=arm设置目标为arm架构
  2. CROSS_COMPILE 指定所使用的交叉编译器
  3. make distclean清理工程
  4. make mx6ull_14x14_ddr512_emmc_defconfig,用于配置uboot,配置文件为mx6ull_14x14_ddr512_emmc_defconfig
  5. make -j12 表示使用12核来编译uboot

ubuntu@ubuntu-vpc:~/桌面/uboot$ ls
api        configs   include      Makefile         test        u-boot.lds
arch       disk      Kbuild       net              tmp         u-boot.map
board      doc       Kconfig      post             tools       u-boot-nodtb.bin
build.sh   drivers   lib          README           u-boot      u-boot.srec
cmd        dts       Licenses     scripts          u-boot.bin  u-boot.sym
common     examples  MAINTAINERS  snapshot.commit  u-boot.cfg
config.mk  fs        MAKEALL      System.map       u-boot.imx
  1. u-boot.bin 是编译出来的二进制文件
  2. uboot是裸机程序需要加入头部才能在I.MX6U上运行。
  3. u-boot.imx是增加了头部的镜像文件

写个shell脚本
mx6ull_alientek_emmc.sh

#!/bin/bash
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- distclean
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- mx6ull_14x14_ddr512_emmc_defconfig
make V=1 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- -j12
chmod 777 mx6ull_alientek_emmc.sh
./mx6ull_alientek_emmc.sh

uboot编译后就可以烧录到板子上了
先烧录到SD卡

通过插拔确认sd位置

ubuntu@ubuntu-vpc:~/桌面/uboot$ ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sda5
# 插入
ubuntu@ubuntu-vpc:~/桌面/uboot$ ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sda5  /dev/sdb  /dev/sdb1
ubuntu@ubuntu-vpc:~/桌面/uboot$ ./imxdownload u-boot.bin /dev/sdb 
I.MX6ULL bin download software
Edit by:zuozhongkai
Date:2019/6/10
Version:V1.1
log:V1.0 initial version,just support 512MB DDR3
    V1.1 and support 256MB DDR3
file u-boot.bin size = 377800Bytes
Board DDR SIZE: 512MB
Delete Old load.imx
Create New load.imx
Download load.imx to /dev/sdb  ......
[sudo] ubuntu 的密码: 
记录了743+1 的读入
记录了743+1 的写出
380872 bytes (381 kB, 372 KiB) copied, 4.28332 s, 88.9 kB/s


这篇关于正点原子uboot初始的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程