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

更多推荐