03-20-2017 03:29 PM
Hi, I have a basic question with respect to the DMA that I would like to clarify. I use the DMA (with Memory Map Data Width = 32) in interrupt mode to write to or read from the DDR. Each time an interrupt appears (for writing, for instance), I clear the interrupt and execute the following code:
global_frame_counter++; StartDMATransfer (DDR_BASE_ADDR + X * global_frame_counter, 256);
being DDR_BASE_ADDR = PAR_PS7_DDR_0_S_AXI_BASEADDR = 0x00100000. The first parameter in the call function "StartDMATransfer" is the destination address and the second one the length. I'm not sure which value should have X in the address in order to write the data in the DDR sequentially and without loss of information.
03-23-2017 02:26 AM
after one complete dma transfer, the address of your pointer should point to the next free address in the ddr.
so X is the length of the packet.
But be aware of adding +packet_size to your pointer: if you have a u32-pointer, the address will increase by 4 byte, when adding +1 to the pointer.
in this case, X is (packet_size) / (sizeof(u32)) //or u8, if your ptr is u8...