ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

正点原子uboot初始

2021-11-02 22:32:40  阅读:260  来源: 互联网

标签:uboot scripts boot dev 正点 ubuntu arm 初始


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,scripts,boot,dev,正点,ubuntu,arm,初始
来源: https://blog.csdn.net/lzw508170827/article/details/121109996

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有