[Question] DMA Transfer in PCI Express

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi. Everyone.

I'm Developing a Device Driver for my Express board.
And I already got so many helps in this discussion group.
I have been appreciated to DDK MVPs in this group. Thank you.

I have a question again.

My device doen't support Scatter & gather DMA, So, I decided to transfer
data with Common buffer type.

I could successfully create DMA adapter for my board using IoGetDmaAdapter
function.
================================
pdx->pDmaAdapter = IoGetDmaAdapter(pdx->Pdo, &pdx->deviceDescription,
&pdx->nMapRegs);
================================
And Created Common buffer to transfer data
And Marked to 0xa5 to identify if there any changes.
================================
pdx->VirtualBuffAddr =
pdx->pDmaAdapter->DmaOperations->AllocateCommonBuffer(pdx->pDmaAdapter, 4096,
&pdx->PhysicalBuffAddr, TRUE);
pdx->uPhysicalAddress = pdx->PhysicalBuffAddr.LowPart;
memset(pdx->VirtualBuffAddr, 0xa5, 4096); // To mark memroy
================================
And I sent Physical Address to my device to let my device to transfer data
to the physical address.

After transfering(I checked if correct packets generated in FPGA) datas.
I couldn't find any differences than before. Nothing happened.

Should I have to use another address for my device to transfer?

Please let me know. Thank you
 
I found something.

After the transfer I tried to print*((unsigned int *)pdx->VirtualBuffAddr))
And, that value was not changed.
When I test another memory like below
for (l_i =0 ;l_i < 32; l_i++) *((unsigned int *)pdx->VirtualBuffAddr+l_i))

I found change after second memory.

Now i'm trying to find what makes this buffer not to be written correctly..

Thank you for your interesting. Have a nice day.
 
Back
Top