Vitis Drivers API Documentation
xaxicdma_example_sg_poll.c File Reference


This file demonstrates how to use the xaxicdma driver on the Xilinx AXI CDMA core (AXICDMA) to transfer packets in scatter gather transfer mode without interrupt.

The completion of the transfer is checked through polling. Using polling mode can give better performance on an idle system, where the DMA engine is lowly loaded, and the application has nothing else to do. The polling mode can yield better turn-around time for DMA transfers.

To see the debug print, you need a uart16550 or uartlite in your system, and please set "-DDEBUG" in your compiler options for the example, also comment out the "#undef DEBUG" in xdebug.h. You need to rebuild your software executable.

Make sure that MEMORY_BASE is defined properly as per the HW system.

Ver   Who  Date     Changes

1.00a jz 07/30/10 First release 2.01a rkv 01/28/11 Modified function prototype of XAxiCdma_SgPollExample to a function taking only one arguments i.e. device id. 2.01a srt 03/05/12 Added V7 DDR Base Address to fix CR 649405. Modified Flushing and Invalidation of Caches to fix CRs 648103, 648701. 2.02a srt 03/01/13 Updated DDR base address for IPI designs (CR 703656). 4.1 adk 01/07/16 Updated DDR base address for Ultrascale (CR 799532) and removed the defines for S6/V6. 4.3 ms 01/22/17 Modified xil_printf statement in main function to ensure that "Successfully ran" and "Failed" strings are available in all examples. This is a fix for CR-965028. ms 04/05/17 Modified Comment lines in functions to recognize it as documentation block for doxygen generation of examples. 4.4 rsp 02/22/18 Support data buffers above 4GB.Use UINTPTR for typecasting buffer address(CR-995116). 4.6 rsp 09/13/19 Fix cache maintenance ops for source and dest buffer. 4.7 rsp 12/06/19 For aarch64 include xil_mmu.h. Fixes gcc warning. 4.10 sa 08/12/22 Updated the example to use latest MIG cannoical define i.e XPAR_MIG_0_C0_DDR4_MEMORY_MAP_BASEADDR. 4.11 sa 09/29/22 Fix infinite loops in the example.


int XAxiCdma_SgPollExample (u16 DeviceId)
 The example to do the scatter gather transfer through polling. More...
int main ()
 The entry point for this example. More...

Function Documentation

int main ( void  )

The entry point for this example.

It sets up uart16550 if one is available, invokes the example function, and reports the execution status.

  • XST_SUCCESS if example finishes successfully
  • XST_FAILURE if example fails.

References XAxiCdma_SgPollExample().

int XAxiCdma_SgPollExample ( u16  DeviceId)

The example to do the scatter gather transfer through polling.

DeviceIdis the Device Id of the XAxiCdma instance
  • XST_SUCCESS if example finishes successfully
  • XST_FAILURE if error occurs

References XAxiCdma_CfgInitialize(), XAxiCdma_LookupConfig(), XAxiCdma_Reset(), and XAxiCdma_ResetIsDone().

Referenced by main().