Post Go back to editing

AD9361 No-OS Rx DMA Cyclic Mode

I am working on AD9361 with No-OS driver.

Sample code of the No-OS driver provides cyclic dma at the Tx side.

It is working very well.

Now, I want to use cyclic dma at the Rx side to receive data into ring buffer continuously, so that there is no data loss.

I set 'AXI_DMAC_REG_FLAGS' to one. However, it doesn't seem to work.

How can I use cyclic dma at the Rx side.



int32_t adc_capture(uint32_t size, uint32_t start_address)




 adc_dma_write(AXI_DMAC_REG_CTRL, 0x0);

 adc_dma_write(AXI_DMAC_REG_IRQ_MASK, 0x0);

 // Cyclic Mode 0:OFF, 1:ON
 adc_dma_write(AXI_DMAC_REG_FLAGS, 0x1);

 adc_dma_read(AXI_DMAC_REG_TRANSFER_ID, &transfer_id);

 adc_dma_write(AXI_DMAC_REG_DEST_ADDRESS, start_addr);
 adc_dma_write(AXI_DMAC_REG_DEST_STRIDE, 0x0);
 adc_dma_write(AXI_DMAC_REG_X_LENGTH, length - 1);
 adc_dma_write(AXI_DMAC_REG_Y_LENGTH, 0x0);

 // Transfer Start
 adc_dma_write(AXI_DMAC_REG_START_TRANSFER, 0x1);

 /* Wait until the new transfer is queued. */
 do {
  adc_dma_read(AXI_DMAC_REG_START_TRANSFER, &reg_val);
 while(reg_val == 1);


return 0;