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.

How to Create Circular (Ring) buffer from UART using DMA?

Other Parts Discussed in Thread: EK-TM4C123GXL, TM4C1294NCPDT

How to Create Circular (Ring) buffer from UART using DMA Ping-pong or Scatter-gather?

Thanks 

Sayed abdullah

  • Hello Sayed

    Did you check the Ping-Pong example in TIVAWare

    C:\ti\TivaWare_C_Series-2.1.0.12573\examples\boards\ek-tm4c123gxl\udma_demo

    Regards

    Amit

  • I have done it successfully using the ping-pong mode on TM4C1294NCPDT.

    char buffer[BUFFERS][TRANSFERSIZE];

    When you call uDMAChannelTransferSet you loop through the buffers and the DMA controller will fill the buffer in a circular fashion. Using uDMAChannelSizeGet you can figure out where the DMA controller is currently writing to. You have to check for buffer overflow when you reset a channel to make sure you're writing over data before you have read it.

    This lets you create a buffer that is larger than would otherwise be permitted in strict ping-pong mode.