FPGA挂载NVME SSD(二)

本文详细介绍在Ubuntu环境下使用Petalinux2017.2进行Zynq平台的FPGA驱动开发流程,包括环境搭建、工程创建、硬件描述文件导入、内核与根文件系统配置、编译及通过JTAG启动的全过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

  1. 首先要在Ubuntu下安装Petalinux 2017.2
  2. 设置Petalinux 环境变量
source /<your-petalinux-install-dir>/settings.sh
  1. 新建目录~/projets/fpga-drive-aximm-pcie
  2. 把Windows下的Vivado工程复制到~/projets/fpga-drive-aximm-pcie下
  3. 新建Petalinux工程
petalinux-create --type project --template zynq --name petalinux_prj
  1. 切换到petalinux_prj目录
cd petalinux_prj/
  1. 导入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
  1. 打包并通过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文件,并进行读写。

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值