OpenDGPS / zynq-axi-dma-sg

Simple C snippet to transfer DMA memory with scatter/gather on a Zynq 7020
50 stars 28 forks source link

DMA engine reset not correct #5

Open larspontoppidan opened 3 years ago

larspontoppidan commented 3 years ago

The reset of the DMA engine is not correct:

    axi_dma_register_mmap[MM2S_CONTROL_REGISTER >> 2] =  0x4;
    axi_dma_register_mmap[S2MM_CONTROL_REGISTER >> 2] =  0x4;
    axi_dma_register_mmap[MM2S_CONTROL_REGISTER >> 2] =  0x0;
    axi_dma_register_mmap[S2MM_CONTROL_REGISTER >> 2] =  0x0;
  1. The control register should not be set to 0 again, the DMA core will do that when ready. Ideally there should be a loop waiting for the reset bit to go low
  2. It is only necessary to reset either MM2S or S2MM, it will reset the entire block