UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Visitor crts1973
Visitor
3,974 Views
Registered: ‎09-06-2011

xapp859 DMA data corruption/alignment in Linux

Jump to solution

Hello,

 

I am having a peculiar problem with the xapp859. I have tested the desing using XP with the provided driver and gui application. I then developed a Linux driver, which I am having a few problems with. Whenever I transfer a chunk of data to the FPGA and then read it back, it will be offset by 16 bytes. The first 16 bytes, instead of being zero, are the last 16 bytes of the previous transfer that had been cut off. 

 

For reference, here is the process that I use to initiate a DMA transfer:

 

Copy data from userspace to kernelspace into a buffer created using pci_alloc_consistent

Set DDR2 ram address to 0

Set host address to physical address returned by pci_alloc_consistent

Set size to 4096 (same as buffer)

Start transfer by writing bit

Poll for transfer to finish

 

I do the same for reading the data out except that I write the other start bit (for the other direction) and then copy the data back to user space when everything has finished.

 

Any insight would be appreciated, especially from someone who as developed a linux driver for this app note.

 

Thank you,

0 Kudos
1 Solution

Accepted Solutions
Visitor crts1973
Visitor
4,991 Views
Registered: ‎09-06-2011

Re: xapp859 DMA data corruption/alignment in Linux

Jump to solution

I solved this problem. There needs to be a slight delay between when you tell the card to start the transfer and when you start polling the transfer done bit. 

0 Kudos
1 Reply
Visitor crts1973
Visitor
4,992 Views
Registered: ‎09-06-2011

Re: xapp859 DMA data corruption/alignment in Linux

Jump to solution

I solved this problem. There needs to be a slight delay between when you tell the card to start the transfer and when you start polling the transfer done bit. 

0 Kudos