axidma
Xilinx SDK Drivers API Documentation
xaxidma_example_sgcyclic_intr.c File Reference

Overview

This file demonstrates how to use the xaxidma driver on the Xilinx AXI DMA core (AXIDMA) to transfer packets in interrupt mode when the AXIDMA core is configured in Scatter Gather Mode.

This example demonstrates how to use cyclic DMA mode feature. This program will recycle the NUMBER_OF_BDS_TO_TRANSFER buffer descriptors to specified number of cyclic transfers defined in "NUMBER_OF_CYCLIC_TRANSFERS".

This code assumes a loopback hardware widget is connected to the AXI DMA core for data packet loopback.

To see the debug print, you need a Uart16550 or uartlite in your system, and please set "-DDEBUG" in your compiler options. You need to rebuild your software executable.

Make sure that MEMORY_BASE is defined properly as per the HW system. The h/w system built in Area mode has a maximum DDR memory limit of 64MB. In throughput mode, it is 512MB. These limits are need to ensured for proper operation of this code.

MODIFICATION HISTORY:
Ver   Who  Date     Changes
----- ---- -------- -------------------------------------------------------
9.4   adk  25/07/17 Initial version.
9.6   rsp  02/14/18 Support data buffers above 4GB.Use UINTPTR for storing
                    and typecasting buffer address(CR-992638).

Functions

int main (void)
 Main function. More...
 

Function Documentation

◆ main()

int main ( void  )

Main function.

This function is the main entry of the interrupt test. It does the following:

  • Set up the output terminal if UART16550 is in the hardware build
  • Initialize the DMA engine
  • Set up Tx and Rx channels
  • Set up the interrupt system for the Tx and Rx interrupts
  • Submit a transfer
  • Wait for the transfer to finish
  • Check transfer status
  • Disable Tx and Rx interrupts
  • Print test status and exit
Parameters
None
Returns
  • XST_SUCCESS if tests pass
  • XST_FAILURE if fails.
Note
None.