04-22-2020 10:37 PM
Hello, Xilinx Employees,
I am currently implementing AXI DMA Scatter-Gather mode on ZCU104 board.
The data source for this board is the AXI stream module that I built as the below image.
In this block design, AXI DMA only works in receive mode and has 64bit bus width and 256 burst size.
One DMA transaction size of word is 1000, and 64 cycles of transaction is performed.
Two DMA memories are used in the design and the values of two regions are 0x0130_0000 and 0x0170_0000.
It seems that the data from the data source are stored on the DMA memory correctly.
When I see the data from the memoy monitor of the SDK, sequence numbers are aligned in a correct order as below figure.
BUT, when I read a certain memory region(Address = 0x01301F40) on my UART screen, wrong values are read.
As seen above, the read value is 0x3333_3333 and desired value is 0x0000_07d0.
I don't know why this is happening and I am in severe trouble because of this.
(I have an experience on AXI DMA scatter-gather mode on ZCU102 board and at that time,
the DMA worked perfectly)
Please let me solve this problem.
04-24-2020 09:29 AM
This issue sounds like it is due to cache.
If the cpu writes to the address, then the cache will hold the value written. So the next time the cpu reads the address, it will get the data value from cache and not from the memory where dma has modified the address contents.
So do a cache invalidate before the cpu reads the address.
04-26-2020 05:38 PM - edited 04-26-2020 05:59 PM
Hi, Thanks for the reply.
I already tried the cache invalidation as below.
I used the cache invalidation function in two locations.
One is in interrupt callback as above and the other is in the main loop.
But the two methods resulted in the same failure.
My methods might be wrong. If you see any fault in the code, let me know that.
(One thing you should notice is that I have successfully implemented the AXI DMA in ZCU102
using the same method described above)
05-01-2020 07:12 AM
Try using xsct, set the target to a53-0 and try to read that memory location. If you get the correct value, then I would take a closer look at your print statement.
05-03-2020 11:10 PM
I attach the image captured by your description.
As seen in the figure, mrd in xsct shows the same result in memory monitor.
My read code is below. Please give me hints. Thanks.
for (i = 0; i < CHUNK_SIZE_IN_BYTE/4; i++)
readVal[i] = *(pReadDmaBuffer + i);
if (readVal[i] != i)
NvsDisplayDoPrintf(infoLineCnt++, 0, "Error occurred : 0x%08X, 0x%08X, Addr : 0x%08X", readVal[i], i, (pReadDmaBuffer + i));