FPGA挂载NVME SSD(二)

1. 首先要在Ubuntu下安装Petalinux 2017.2
2. 设置Petalinux 环境变量
source //settings.sh

3. 新建目录~/projets/fpga-drive-aximm-pcie
4. 把Windows下的Vivado工程复制到~/projets/fpga-drive-aximm-pcie下
5. 新建Petalinux工程
petalinux-create --type project --template zynq --name petalinux_prj

6. 切换到petalinux_prj目录
cd petalinux_prj/

7. 导入HDF
petalinux-config --get-hw-description ../fpga-drive-aximm-pcie-2017v2_hpc/Vivado/zc706_hpc_pcie/zc706_hpc_pcie.sdk/

随之弹出Linux System Configuration界面,不做任何更改,保存退出

8. 配置内核
petalinux-config -c kernel

Check: Bus options->PCI support should already be enabled by default
Check: Bus options->PCI support->Message Signaled Interrupts (MSI and MSI-X) should already be enabled by default
Check: Bus options->PCI support->Enable PCI resource re-allocation detection should already be enabled by default
Check: Bus options->PCI support->PCI host controller drivers->Xilinx AXI PCIe host bridge support should already be enabled by default
Enable: Device Drivers->Block devices->NVM Express block device

9. 配置根文件系统
petalinux-config -c rootfs

Configure the root file system to include some utilities we will need to setup the NVMe PCIe SSD:
Enable PCI utils (for lspci): Filesystem Packages->console/utils->pciutils->pciutils
Enable required packages for lsblk, fdisk, mkfs, blkid:
[ ] Filesystem Packages->base->util-linux->util-linux Filesystem
Packages->base->util-linux->util-linux-blkid Filesystem
Packages->base->util-linux->util-linux-fdisk Filesystem
Packages->base->util-linux->util-linux-mkfs Filesystem
Packages->base->util-linux->util-linux-mount Filesystem
Packages->base->e2fsprogs->e2fsprogs Filesystem
Packages->base->e2fsprogs->e2fsprogs-mke2fs

10. 编译
petalinux-build

11. 打包并通过JTAG启动
petalinux-package --boot --fsbl ./images/linux/zynq_fsbl.elf --fpga ../fpga-drive-aximm-pcie-2017v2_hpc/Vivado/zc706_hpc_pcie/zc706_hpc_pcie.runs/impl_1/zc706_hpc_pcie_wrapper.bit --uboot --force

petalinux-package --prebuilt --fpga ../fpga-drive-aximm-pcie-2017v2_hpc/Vivado/zc706_hpc_pcie/zc706_hpc_pcie.runs/impl_1/zc706_hpc_pcie_wrapper.bit

petalinux-boot --jtag --prebuilt 3 --fpga --bitstream ../fpga-drive-aximm-pcie-2017v2_hpc/Vivado/zc706_hpc_pcie/zc706_hpc_pcie.runs/impl_1/zc706_hpc_pcie_wrapper.bit

不过我的JTAG启动不成功,懒得折腾了,把/petalinux_prj/images/linux目录下的image.ub, zynq_fsbl.elf, u-boot.elf和zc706_hpc_pcie_wrapper.bit拷贝到Windows下,将zynq_fsbl.elf, u-boot.elf和zc706_hpc_pcie_wrapper.bit生成BOOT.BIN,最后将BOOT.BIN和image.ub放到SD卡,上电启动
后续测试详细添加链接描述

对SSD进行分区,并在SSD中新建.txt文件,并进行读写。

文章转载自: https://blog.csdn.net/zkf0100007/article/details/84197247

最新文章

最新文章