PCIE DMA寄存器出错
想用FPGA跟PC通过DMA通信:
Qsys 配置如图:
驱动写 DMA 代码:
KdPrint((" 中断已经注册 \n"));
// 1. 设置DMA参数
WRITE_REGISTER_ULONG((PULONG)(g_MemRegister + 0x4000 + 0x04), (ULONG)0xffffffff); // DMA 读地址
WRITE_REGISTER_ULONG((PULONG)(g_MemRegister + 0x4000 + 0x08), (ULONG)0xffffffff); // DMA 写地址
//WRITE_REGISTER_ULONG((PULONG)(g_MemRegister + 0x4000 + 0x08), (ULONG)m_pycialAddressForImage.LowPart);
WRITE_REGISTER_ULONG((PULONG)(g_MemRegister + 0x4000 + 0x0C), (ULONG)0x0); // DMA 长度
DumpBuffer(g_MemRegister + 0x4000 , 0x40); // 打印日志
DumpBuffer 打印出来的,内容:
跟我想要的完全不一样, 这是什么原因啊?
作者微信号: xh66i88