I am getting a 50400 timeout error when attempting to read from an FPGA DMA FIFO. I use the polling method for reading from the FIFO, where I first read 0 elements to get the number of elements remaining in the FIFO and then use that number in a second read as the number of elements to read. The problem is that I am intermittently getting a timeout error on the second read. It seems that the first read is returning that there are 180 elements remaining but when I attempt to read that many elements on the second read, I get the timeout, and the data elements remaining (from the second read) says that there are 179 elements remaining. This suggests that either the first read is giving me the wrong number of elements or that the data elements remaing returned in the second read is wrong. The timeout would make sense if there were really only 179 elements when I attempted to read 180. I don't understand the discrepency. I have both timeouts for the read set to 0 (on a side note, why is the precision for the timeout in ms and not us).
Any suggestions or comments on what is happening or what I may be doing incorrectly?
Thanks,
Kevin C.