Because of the holidays, TI E2E™ design support forum responses will be delayed from Dec. 25 through Jan. 2. Thank you for your patience.

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-CC26X2R1: How to increase UART RX buffer size in RTLS project

Part Number: LAUNCHXL-CC26X2R1
Other Parts Discussed in Thread: SYSCONFIG

Hi all,

I find below issue maybe caused by UART transmit over 32byte from PC to CC2652

https://e2e.ti.com/support/wireless-connectivity/bluetooth-group/bluetooth/f/bluetooth-forum/985262/launchxl-cc26x2r1-launchxl-cc26x2r1-timeout-master-node-to-set-connectionless-aoa-state-numant-issue/3664860?tisearch=e2e-sitesearch&keymatch=valery%20ANT#3664860

I use 2 type of USB to UART cable, FTDI and TI EVB board. if i want enable ANT >= 16, total CLAOA_ENABLE packet is 33 bytes, but AOA_ENABLE is 32 bytes

1. if use FTDI driver can't get any response from Master after transmit CLAOA_ENABLE command, the interval between 2 bytes is 0.16us

2.when use TI driver, we can get response from Master after transmit CLAOA_ENABLE command, the interval between 2bytes is 3.38us

looks like the UART ring buffer size is 32 bytes in syscfg. so i think if PC transmit too fast and over 32bytes, maybe cause the 1st byte(0x7E) be override, so won't response CLAOA_ENABLE command

but after change ring buffer size > 33 bytes, still not work, and can't find npi_tl_uart use this ring buffer. how can i increase the UART RX buffer size

  • Hi Valery,

    Good to talk to you.

    Generally speaking the rtls_coordinator device setup the UART in the function RTLSHost_openHostIf() in the file RTLSCtrl/rtls_host_npi.c

      // Initialize NPI Interface
      NPITask_Params_init(NPI_SERIAL_TYPE_UART, &npiPortParams);
    
      npiPortParams.stackSize = NPI_TASK_STACK_SIZE;
      npiPortParams.mrdyPinID = MRDY_PIN;
      npiPortParams.srdyPinID = SRDY_PIN;
      npiPortParams.bufSize   = NPI_MSG_BUFF_SIZE;
      npiPortParams.portParams.uartParams.baudRate = 460800;

    As you mention, the UART ring buffer size is defined through SysConfig. This parameter affects the lower levels of the UART driver. In other words, the NPI cannot impact it.

    I have run some tests using our Python examples. I have set a 36-element long antenna pattern and it get properly accepted.

    [2021-08-18 10:26:17,741]  rtlsnode -     INFO - COORDINATOR  : 80:6F:B0:1E:55:F7 <-- {'type': 'Command', 'command': 'RTLS_CMD_CL_AOA_ENABLE', 'payload': {'aoaRole': 'AOA_COORDINATOR', 'aoaResultMode': 'AOA_MODE_RAW', 'syncHandle': 0, 'enable': 1, 'slotDuration': 2, 'sampleRate': 1, 'sampleSize': 1, 'sampleCtrl': 16, 'maxSampleCte': 1, 'numAnt': 36, 'pAntPattern': [0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 6, 7, 8, 9, 10, 11, 6, 7, 8, 9, 10, 11]}}
    [2021-08-18 10:26:17,742] serialnode -    DEBUG - >>> UNPIMessage(originator=Ap type=SyncReq, subsystem=25, command=RTLS_CMD_CL_AOA_ENABLE, data=01:00:00:00:01:02:01:01:10:01:24:00:01:02:03:04:05:00:01:02:03:04:05:00:01:02:03:04:05:06:07:08:09:0A:0B:06:07:08:09:0A:0B:06:07:08:09:0A:0B)
    [2021-08-18 10:26:17,742] serialnode -    DEBUG - >>> FE:2F:00:39:15:01:00:00:00:01:02:01:01:10:01:24:00:01:02:03:04:05:00:01:02:03:04:05:00:01:02:03:04:05:06:07:08:09:0A:0B:06:07:08:09:0A:0B:06:07:08:09:0A:0B:34
    [2021-08-18 10:26:17,792] serialnode -    DEBUG - <<< FE:01:00:79:15:00:6D
    [2021-08-18 10:26:17,792] serialnode -    DEBUG - <<< 
    [2021-08-18 10:26:17,792] serialnode -    DEBUG - <<< UNPIMessage(originator=Nwp type=SyncRsp, subsystem=RTLS, command=RTLS_CMD_CL_AOA_ENABLE, data=00)
    [2021-08-18 10:26:17,792] serialnode -    DEBUG - <<< 

    Could you please specify if you have modified the UART baudrate? (My tests were run 460800 baudrate)

    Best regards,

  • Hi Clement.

    baud rate is 3000000. Did you test on TI EVB board with XDS110 debug board?

    I know the latest python script default set to 36 ANT, and test pass with XDS110

    but the XDS110's driver have larger interval time(3.38us) between byte and byte.

    other MCU or PC UARAT driver have smaller interval time(0.16us), but can send data success when data small than 32byte.

    so i doubt that ring buffer size is not enough to buffer data when data send too fast.

    Does RTLS use ring buffer in UART driver?  How to correctly increase it?

     
  • Hi Valery,

    Actually, I think you are running into the limits of the device. With 3Mbaud the hardware is limited to 32 byte received back to back.

    Based on the UARTCC26XX.h file:

    /* 
     *  # Baud Rate #
     *  The CC26xx driver supports baud rates up to 3Mbaud.
     *  However, when receiving more than 32 bytes back-to-back the baud
     *  rate is limited to approximately 2Mbaud.
     *  The throughput is also dependent on the user application.
     */

    The only solution here is to implement a workaround.

    • Do you think you could use a lower baudrate (2M)?
    • Do you think you could find a workaround and not transmit such a long frame?
      For example, if all the devices have the same antenna configuration, you could modify the embedded code and not transmit every time the antenna configuration.

    Best regards,

  • Very thx Clement,

    Yes I already have workaround.