VS2015+WDK10环境下PCIe_XDMA驱动工程编译

我们的目的是修改官方驱动中对单次传输文件大小的限制,官方示例中将单次传输大小限制在了8MB。因此需要修改参数并重新编译工程。

开始之前需要搭建好VS2015+WDK的驱动开发环境。

本文的工作基于赛灵思官方XDMA驱动工程,如果对原始工程能进行正确配置编译则在原工程上修改编译即可,可忽略本文,。本文的方法适于无法对源工程完成正确配置和编译时,利用官方的源码单独建立工程完成编译。

另:本文的部分配置工作也可作为原始工程配置的参考!

1.新建WDF项目,KMDF模式下会套用模板,可避免后续编译中出现.tmh缺少的报错

2.将驱动代码文件逐个导入,最好是用添加-新建项来完成

 

3.工程属性的配置(非常重要)

右键点击项目名称,选择属性,依次做以下修改

 

 

 

 

 

 

3.为修改传输大小的限制,找到驱动文件dma_engine.h文件中的参数MAX_TRANSFER_SIZE,默认模式下是8*1024*1024,我们改为64

4.生成XDMA驱动文件

 

但是此时的驱动还是无法安装,因为inf文件没有修改,安装驱动时会提示无法找到驱动文件

 

但是,如果直接将xilinx的inf文件拷贝进来,在编译时会出现报错,大意是inf文件中该目录定义了两次,此问题已邮件xilinx的驱动作者

alexande <alexande@xilinx.com>

 

 

 

自己的解决办法是:在默认INF时可以成功编译驱动,那就在编译成功后,用xilinx生成的可用驱动文件下的INF文件进行替换,实践证明可行

 

5.成功安装后(注意安装之前要把系统设置为测试模式,设置方法自行百度)

在cmd中运行xdma_rw.exe,以h2c_0模式写入一个约60MB的文件,提示写入成功,速度约4.8GB/s

2018.1.22修改传输限制为128M,测试结果

 

 

相关推荐
xilliix pcie dma 驱动 (基于 xilnx xdma ip核 4.0 的WDF驱动) --- # XDMA Windows Driver This project is Xilinx's sample Windows driver for 'DMA/Bridge Subsystem for PCI Express v4.0' (XDMA) IP. *Please note that this driver and associated software are supplied to give a basic generic reference implementation only. Customers may have specific use-cases and/or requirements for which this driver is not suitable.* ### Dependencies * Target machine running Windows 7 or Windows 10 * Development machine running Windows 7 (or later) * Visual Studio 2015 (or later) installed on development machine * Windows Driver Kit (WDK) version 1703 (or later) installed on development machine ## Directory Structure ``` / |__ build/ - Generated directory containing build output binaries. |__ exe/ - Contains sample client application source code. | |__ simple_dma/ - Sample code for AXI-MM configured XDMA IP. | |__ streaming_dma/ - Sample code for AXI-ST configured XDMA IP. | |__ user_events/ - Sample code for access to user event interrupts. | |__ xdma_info/ - Utility application which prints out the XDMA core ip | | configuration. | |__ xdma_rw/ - Utility for reading/writing to/from xdma device nodes such | | as control, user, bypass, h2c_0, c2h_0 etc. | |__ xdma_test/ - Basic test application which performs H2C/C2H transfers on | all present channels. |__ inc/ - Contains public API header file for XDMA driver. |__ libxdma/ - Static kernel library for XDMA IP. |__ sys/ - Reference driver source code which uses libxdma |__ README.md - This file. |__ XDMA.sln - Visual Studio Solution. ```
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页