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.

CC3200-LAUNCHXL: CC3200 - UART PING PONG uDMA - overrun error - UART_RXERROR_OVERRUN

Part Number: CC3200-LAUNCHXL
Other Parts Discussed in Thread: ENERGIA

I am making a device to transmit data* recieved by UART continuously at 2 MHz - I have already implemented this with uDMA  in PING PONG mode and the uDMA and wireless transmission* work fine  - no packets are missed and the dma switches nicely between PRI and ALT channels.

Unfortunately, I have discovered that I am getting an overrun error (checked with ulStatus = uDMAErrorStatusGet(), returns 8, UART_RXERROR_OVERRUN) every 54 buffers (27 pairs of PRI and ALT) that I transmit* and I have found that it is always caused by the ALT buffer! As a result, an empty buffer is sent and number of data sampled usually contained in the buffer packet are missed. I am using Energia IDE.

Any Ideas how to fix this?

Edit: *all words related to transmission refer wireless tranmssion not UART Tx

  • Hi Maciej,

    Could you post a code snippet of how you are setting up the DMA? I'm curious as to why you have set the UART for transmitting, but are getting RX errors. 

  • Sorry for the confusion - by transmision/tranmsit I am only refering to wireless transmission - not UART Tx.

    Anyway here is my UART init function:

    void InitUART0Transfer(void)
    {
    unsigned int uIdx;

    MAP_PRCMPeripheralReset(PRCM_UARTA0);
    MAP_PRCMPeripheralClkEnable(PRCM_UARTA0,PRCM_RUN_MODE_CLK);

    MAP_UARTConfigSetExpClk(CONSOLE,SYSCLK, UART_BAUD_RATE,
    (UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE |
    UART_CONFIG_PAR_NONE | UART_FLOWCONTROL_RX ));

    MAP_uDMAChannelAssign(UDMA_CH8_UARTA0_RX);
    MAP_UARTIntRegister(UARTA0_BASE,UART0IntHandler);

    //flow control - maybe this does something
    MAP_UARTFlowControlSet(UARTA0_BASE,UART_FLOWCONTROL_RX);

    // Set both the TX and RX trigger thresholds to 4. This will be used by
    // the uDMA controller to signal when more data should be transferred. The
    // uDMA TX and RX channels will be configured so that it can transfer 4
    // bytes in a burst when the UART is ready to transfer more data.
    MAP_UARTFIFOLevelSet(UARTA0_BASE, UART_FIFO_TX4_8, UART_FIFO_RX4_8);

    // Enable the UART for operation, and enable the uDMA interface for both TX
    // and RX channels.
    MAP_UARTEnable(UARTA0_BASE);

    // Enable the UART peripheral interrupts. uDMA controller will cause an
    // interrupt on the UART interrupt signal when a uDMA transfer is complete.
    MAP_UARTIntEnable(UARTA0_BASE,UART_INT_DMARX);

    // Configure the control parameters for the UART TX. The uDMA UART TX
    // channel is used to transfer a block of data from a buffer to the UART.
    // The data size is 8 bits. The source address increment is 8-bit bytes
    // since the data is coming from a buffer. The destination increment is
    // none since the data is to be written to the UART data register. The
    // arbitration size is set to 4, which matches the UART TX FIFO trigger
    // threshold.
    SetupTransfer(UDMA_CH8_UARTA0_RX | UDMA_PRI_SELECT, UDMA_MODE_PINGPONG,
    sizeof(g_ucRxBufA)-buff_margin,UDMA_SIZE_8, UDMA_ARB_4,
    (void *)(UARTA0_BASE + UART_O_DR), UDMA_SRC_INC_NONE,
    g_ucRxBufA, UDMA_DST_INC_8);

    SetupTransfer(UDMA_CH8_UARTA0_RX | UDMA_ALT_SELECT, UDMA_MODE_PINGPONG,
    sizeof(g_ucRxBufB)-buff_margin,UDMA_SIZE_8, UDMA_ARB_4,
    (void *)(UARTA0_BASE + UART_O_DR), UDMA_SRC_INC_NONE,
    g_ucRxBufB, UDMA_DST_INC_8);

    MAP_UARTDMAEnable(UARTA0_BASE, UART_DMA_RX);
    }

  • Is the issue resolved if you are to disable ping pong mode? Do you need the higher throughput that comes with ping pong mode? 

  • I am not sure how to test the disabling of ping pong mode - this will stop my code from working entirely as I send wifi packets in the ping pong udma interrupt.

    I did try this: if I remove the wifi tranmission part - no overrun error occurs and the ping pong udma appears to run smoothly.

    I have also tried moving the wifi tranmssion out of the dma interrupt and into the loop. This stopped the overrun errors but data packets were now being missed, creating even more problems.

    As for throughput I need about 1000 128 byte chunks a second - this is sent in a continuous fashion so i need ping pong mode.

    I can send you the code so you can take a look.

  • Hi Maciej,

    If you were to switch to UART1, would you notice the same issues?

  • Yes I have tried it - no change same error