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.

CC1310: Is it necessary to add a ring buffer to handle UART RX in TI-RTOS?

Part Number: CC1310

Hi,

I am not quite sure if a ring buffer is already provided by TI-RTOS when dealing with UART RX. If not, then it is probably safer to add one in application. So please advise.

Update: according to this post, UART driver included a ring buffer but by default the ring buffer is disabled as of SDK V1.40. Is there any update to the UART driver? I assume TI-RTOS doesn't provide a ring buffer, and it has to be dealt with in application layer.

Thanks,

ZL

  • The post you link to has a question about why the ring buffer has different size dependent on the board file. 

    If you look in the newest SDK version (4.10) you see that the ring buffer is defined as follows in the board file:

    uint8_t uartCC26XXRingBuffer[CC1310_LAUNCHXL_UARTCOUNT][32];
    
    const UARTCC26XX_HWAttrsV2 uartCC26XXHWAttrs[CC1310_LAUNCHXL_UARTCOUNT] = {
        {
            .baseAddr       = UART0_BASE,
            .powerMngrId    = PowerCC26XX_PERIPH_UART0,
            .intNum         = INT_UART0_COMB,
            .intPriority    = ~0,
            .swiPriority    = 0,
            .txPin          = CC1310_LAUNCHXL_UART_TX,
            .rxPin          = CC1310_LAUNCHXL_UART_RX,
            .ctsPin         = PIN_UNASSIGNED,
            .rtsPin         = PIN_UNASSIGNED,
            .ringBufPtr     = uartCC26XXRingBuffer[CC1310_LAUNCHXL_UART0],
            .ringBufSize    = sizeof(uartCC26XXRingBuffer[CC1310_LAUNCHXL_UART0]),
            .txIntFifoThr   = UARTCC26XX_FIFO_THRESHOLD_1_8,
            .rxIntFifoThr   = UARTCC26XX_FIFO_THRESHOLD_4_8,
            .errorFxn       = NULL
        }
    };

  • Yes, I noticed this block of code. It appears an array for ring buffer is declared and passed to UART driver. And in the driver, 

        //  /simplelink_cc13x0_sdk_4_10_02_04/source/ti/drivers/uart/UARTCC26X0.c
        /* Create circular buffer object to be used for read buffering */
        RingBuf_construct(&object->ringBuffer, hwAttrs->ringBufPtr,
                hwAttrs->ringBufSize);

    In the linked post, there was question that somehow the ring buffer was disabled as of SDK 1.40. Could you confirm that ring buffer is actually enabled and functional as of SDK 4.10? 

  • From the linked post "Usually, the type UARTCC26XX_HWAttrsV2  has the additional fields .ringBufPtr   and .ringBufSize , which are initialized in the CC1310_LAUNCHXL.c but not in the CC1310DK_7XD.c" which indicate that the ringbuffer was enabled for the board file for the Launchpad. 

    And as you can see from the code in the newest version of the driver the ring buffer is in use.