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.

CC2340R5: Link termination occurs when continuously sending data from module to mobile

Part Number: CC2340R5

Tool/software:

Hi,

                           Currently I am working on basic_ble Peripheral profile project. And we are facing an issue when trying to send 1000 bytes of data in a interval of 100ms continuously on UART 115200 baud rate from module to mobile continuously with the MTU size of 20 bytes (we are you waiting for the previous notification to be sent before the next one is queued up to send). After multiple packet transmission from the module, 

 we are facing an link termination event. Where checking the reason of link termination has received  #define LL_STATUS_ERROR_PEER_TERM                      0x13 // Remote User Terminated Connection.

#define UART_MAX_READ_SIZE 1000

uint8_t uartReadBuffer[UART_MAX_READ_SIZE];

UART2_read(uart, &uartReadBuffer, UART_MAX_READ_SIZE, 0);

Status =  SimpleGattProfile_setParameter(SIMPLEGATTPROFILE_CHAR4, 20, &uartReadBuffer[SentDataLen]);  

And here we tried setting the interval calling SimpleGattProfile_setParameter() with 10 milliseconds and without delay. Still facing an disconnection.

Kindly help us with this issue.

SDK Version : simplelink_lowpower_f3_sdk_8_10_01_02

CCS version: CCS 12.7.1

regards,

Vignesh.

 

  • Hi Vignesh,

    Thank you for reaching out.

    Where checking the reason of link termination has received  #define LL_STATUS_ERROR_PEER_TERM                      0x13 // Remote User Terminated Connection.

    This status seems to indicate the connection termination is triggered by the peer (i.e. the mobile phone in your case).

    - Could you please indicate which mobile phone and mobile-app you are using to run the tests? Please make sure to specify the version numbers.

    - Could you please indicate if the same reproduces on other phones and with other apps?

    - Would you happen to have the proper tools to collect sniffer logs?

    Best regards,

  • Hi Clement, 

          While debugging the issue of disconnection we found that uart over run is occurring when trying to send 1000 bytes of data in a interval of 100ms continuously on UART 115200 baud rate from module to mobile.When uart overrun occurs I am trying to restart the module

    Where RX ring buffer size is 3000.

    How to overcome with uart overrun issue.

    where our delivery date was tomorrow so can you pls suggest an solution. 

    Thanks, 

    Vignesh. 

  • Hi Vignesh,

    The bandwidth offered by the UART configuration you have selected (probably around 11 kBytes/s) is quite small compared to the amount of data you are transmitting (10 kBytes/s). I recommend you increase the baudrate used or reduce the amount of data sent.

    Best regards,

  • Hi Clement,

    We have observed two issues during our testing:

    1. Link termination issue
    2. UART overrun

    We have already opened a case for the link termination issue, but we have also noticed the UART overrun problem.

    Link Termination: With a default baud rate of 115200 bps and a packet length of 1000 bytes, we experience link termination issues whether the Tx interval is set to 100 ms or >1sec.

    UART Overrun: With the same default baud rate and packet length, we observe overrun errors and the module enters a hang state, terminating the client connection when the Tx interval is set to less than 1 second.

    Critical point here is that the default baud rate cannot be changed, but the Tx interval can be adjusted. What should the Tx interval be set to for continuous transmission of <1000 bytes or more without encountering link termination or overrun issues?

  • Hi,

    Thank you for the additional information.

    I would suggest to run a test with an interval of 250 ms between the 1000-byte transfers.

    I hope this will help,

    Best regards,

  • Hi Clement,

          Yes, we have performed an testing with an interval of 250 ms and till <3 sec with the 1000 -bytes, still we are facing an issue.

    could you pls suggest an solution.

    Regards,

    Vignesh.

  • Hi Vignesh,

    I would suggest to run a test with an interval of 250 ms between the 1000-byte transfers.

    This suggestion was to ensure the data transmitted over UART fits the bandwidth offered by the UART module.

    The next step is to ensure the throughput offered by the Bluetooth connection allows to offload all the data inputted over UART.

    The application throughput offered by a Bluetooth connection depends on various factors (connection interval, packet size, number of retries, control data). You could try to further increase the interval between the UART packages (maybe start with 1 s interval and increase the value until the issue goes away).

    I hope this will help,

    Best regards,