在linux中配置编译u-boot方法,petalinux编译自己下载的u-boot

petalinux编译自己下载的u-boot

1. 新建工程目录,定位编译链,启动PetaLinux:

cd program/

source /home/admin-hjj/PetaLinux/settings.sh

2. 新建petaLinux工程:

petalinux-create --type project --template zynq --name petalinux_test

3. 将vivado中生成的硬件描述文件拷贝至petalinux_test中

4. 导入硬件描述文件,生成BSP文件

cd petalinux_test

petalinux-config --get-hw-description=/home/admin-hjj/program/h2_petalinux_test

5. 在petalinux的配置界面弹出后,暂时不要配置。打开petalinux_test的工程文件,发现自动生成了一个components文件夹,在此文件夹下新建一个文件夹ext_sources,用来存放下载的u-boot源码。

源码下载:

①直接在shell中输入:

cd program/petalinux_test/components/ext_sources/

git clone -b xilinx-v2018.2  https://github.com/Xilinx/u-boot-xlnx.git

(此时u-boot的代码就在ext_sources/u-boot-xlnx中)

②windows下将源码下载,然后直接COPY到ext_sources文件夹下

(将压缩包复制过去,在ubuntu下解压)

注意:版本号一定要与petalinux的版本对应,否则编译会出错。

6. 在petalinux的配置界面上,将u-boot源文件路径修改为:

${TOPDIR}/../components/ext_sources/u-boot-xlnx

7. 获取文件夹属性:

sudo chmod -R 777 /home/admin-hjj/program/petalinux_test

8. 编译 u-boot

petalinux-config -c u-boot

9. 编译内核

petalinux-config -c kernel

10. 编译rootfs

petalinux-config -c rootfs

11. 编译petalinux工程

petalinux-build

12. 生成BOOT.BIN文件

petalinux-package --boot --format BIN --fsbl zynq_fsbl.elf --fpga system_wrapper.bit

--u-boot

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值