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.

LAUNCHXL-CC1312R1: UART Settings and RingBuffer Size

Part Number: LAUNCHXL-CC1312R1
Other Parts Discussed in Thread: CC1312R

I have a Raspberry PI sending ASCII data to the CC1312R at 921600 baud.  I often received

corrupted data (about 10%).  I don't see problem between 2 Raspberry PI's.  So there might

be issues with the configuration on the CC1312R side.  I am not familiar with UART settings

on the board.  I used these basic settings;

UART_Params_init(&uartParams);
uartParams.writeDataMode = UART_DATA_BINARY;
uartParams.readDataMode = UART_DATA_BINARY;
uartParams.readReturnMode = UART_RETURN_FULL;
uartParams.readTimeout = UART_WAIT_FOREVER;
uartParams.writeTimeout = UART_WAIT_FOREVER;
uartParams.baudRate = 921600;

I have configured the UART RingBuffer size to 4096

and UART FIFO to 1024.  I am writing and reading packets of 96 bytes.  I have not been able to elminate

the corrupted data entirely.  Are there parameters I need to set to make it right?

TW

  • Could you try to use the UART2 driver instead: 

    The UART2 driver is an updated version of the UART driver. The name UART2 was given due to changes in the API, to support backwards compatibility with applications using the existing UART driver. Key differences between the UART and UART2 drivers:

    • UART2 has both RX and TX ring buffers for receiving/sending data.
    • UART2 uses DMA to transfer data between the UART FIFOs and the RX and TX ring buffers.
    • The UART2 APIs for reading and writing data have been made more posix-like.
    • UART2 provides for event notification, allowing the application to receive TX start and completion events, and RX error events.

    Could you also try to reduce the baud rate as a check to see if the amount of corrupt data is a function of the baud rate.   

  • Ter:

        Thanks.  I was thinking about setting up DMA for UART.  So, UART2 is probably the way to go.  I have tried using lower baud rates, but they

    actually gave me more corrupted data.  I think that was because I was processing data in a close loop and the data coming in from the Raspberry PI

    did not reach the CC1312R fast enough.

    TW

  • Let me know if UART2 helps. If not we have to take a closer look at what you do. 

  • Ter:

          UART2 does help.  I am transferring data faster between my Raspberry PI and the CC1312.  However, I think the Raspberry is transferring too fast,

    such that when the cc1312 tries to process the received data, much of the data is overlapped, meaning previous data overwritten by incoming data before the 

    former has a chance to be processed.  I have to slow down the transmission on the Raspberry in order not to overwrite data.  But I really want to push the

    transmit speed on the Raspberry and test how well the CC1312 can perform.  I have already extended the RX ring buffer to 40000, leaving not much memory

    for other use.  Is there a way to extend the FIFO size, too?

    Thanks,

    TW

  • As the reference manual shows the FIFO size is fixed:

    (from https://www.ti.com/lit/pdf/swcu185)

  • Ter:

       Happy New Year!  Thanks for your reply.  From all the information you have provided me, I think I have stressed the UART throughput as far as I can, given the hardware platform and the transmission driver algorithm.  I wasn't so much trying to resolve an issue, but to experiment the optimal data rate with a specific application.  Thanks again for your help.

    TW