This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TI RTOS Ethernet DMA example

Hello,

Is there any example or driver for data transfer over Ethernet using DMA for TM4C1294 Connected Launchpad? 

Thanks.

  • Hi Saleem,
    We don't have any such example or driver for TI-RTOS.
    Best regards,
    Janet
  • Hi Janet,

    Is the NDK is handling all the TCP/IP protocol? and it not using DMA for data tranfer. Is it correct?

    Is there any way to add DMA for data transfer?

    Thanks.
  • Hi Saleem,
    It turns out that I was misinformed about the NDK for Tiva, and the driver actually does use the DMA! You can find the driver in your TI-RTOS installation, under products/tidrivers-tivac_2_xx_xx_xx/packages/ti/drivers/emac/EMACSnow.c
    I hope this is what you were looking for.
    Best regards,
    Janet
  • HI Janet,

    I have found the EMACSnow file. I am bit confused. TIRTOS user guide says:

    The EMAC driver is designed to be used by the NDK. The only function that must be called is the
    EMAC_init() function. This function must be called before BIOS_start() is called to ensure that the driver
    is initialized before the NDK starts.

    But the EMAC_init funciton is not in EMACSnow file. Does the EMAC_init function in file "EMAC.h" initialzes the DMA?

    Does the DMA is used by default for data transfer? OR we need to explicitly call the function "EMACSnow_InitDMADescriptors" to initialize DMA and data transfer.

    Please advice.

    Thanks.
  • Hi Saleem,

    EMAC_init() will call EMACSnow_init().  You shouldn't need to call EMACSnow_initDMADescriptors.  There is table in your board file that is used by the NDK:

    /*
     *  Required by the Networking Stack (NDK). This array must be NULL terminated.
     *  This can be removed if NDK is not used.
     *  Double curly braces are needed to avoid GCC bug #944572
     *  bugs.launchpad.net/.../944572
     */
    NIMU_DEVICE_TABLE_ENTRY NIMUDeviceTable[2] = {
        {
    #if TI_EXAMPLES_PPP
            /* Use PPP driver for PPP example only */
            .init = USBSerialPPP_NIMUInit
    #else
            /* Default: use Ethernet driver */
            .init = EMACSnow_NIMUInit
    #endif
        },
        {NULL}
    };

    This is how the NDK will call EMACSnow_NIMUInit(), wihch initializes the DMA descriptors.

    Best regards,

    Janet

  • Hi Janet,

    Thank you. So by default data transfer over ethernet is done using after DMA EMAC_init() . Is it correct?

    Thanks.
  • Hi Saleem,

    Yes, it uses DMA.  There are Tx and Rx descriptors that are chained up to the peripheral.

    Best regards,

    Janet

  • Hello Saleem, Janet,

    I must clear confusion here if understood correctly the original question. 

    I believe what Saleem is looking for is DMA use in the NDK to copy data (Ethernet frame) from Ethernet driver to application space (from layer2 (MAC frame) to layer 7(application - buffer) )

    What Janet has explained is internal CPSW/MAC DMA which copies ethernet frames from the IP FIFO to ethernet driver. The internal IP DMA uses Rx and Tx descriptors for getting details like address in memory etc.

     Now to answer your question there is no support for using external DMA in the NDK for packet transfer and it relies on CPU copy.

     can confirm if there are any plans in the future.

  • There was a suggested answer and since there has been no active on this thread for more than a week, the suggested answer was marked as verify. Please feel free to select the "Reject Answer" button and reply with more details.