This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Bluetooth connection and serial port sending

Now I come across such a problem, when the device is sending serial port data, at the same time to the mobile phone and bluetooth connection for related business processing, the bluetooth will be disconnected for a timeout.Now suspect is due to the serial port send interrupt events caused, what can be resolved?

  • I read the UARTE interrupt register and found that only RXTO, ERROR, ENDTX, and ENDRX were enabled to interrupt.It is not TXDRDY that causes bluetooth timeout and disconnection, but there is indeed a case of bluetooth timeout and disconnection caused by big data sent by serial port. Could you please help me to analyze and see what causes this situation?thank you

  • 1) What SDK version are you using ?
    2) What IDE / Toolchain are you using ?
    3) Have you tried debugging in your IDE? Are you entering the APP_ERROR_HANDLER() with a error-code ?
    4) Are you using a custom board or a nRF52-DK ?
    5) Do you get the disconnect timeout on the nRF52, BLE_GAP_EVT_DISCONNECTED with reason BLE_HCI_CONNECTION_TIMEOUT ? Or do you get the timeout on the peer(e.g. mobile phone) ?

  • (1)The SDK version used is SDK15.3.0;

    (2)The IDE used is Keil, version 5.15;

    (3)Keil has been used for debugging, APP_ERROR_HANDLER() has only been used for initializing some services, and not elsewhere;

    (4)Use a custom version, not a development board;

    (5)Is the reason obtained in this disconnect event: BLE_HCI_CONNECTION_TIMEOUT.I think I lost the package or a few packets that are still connected are not sent out, resulting in the connection timeout.

    There is a certain relationship with serial port, because as long as I am connected with bluetooth, the serial port will send big data will appear the problem I described above.So, now you want to know how to solve this problem?

  • I set the minimum connection interval to 20ms and the maximum connection interval to 75ms.Later, I set the slave delay to 10-20, but the connection will still be disconnected when the serial port sends a large amount of data during the bluetooth connection. The reason for the connection is still BLE_HCI_CONNECTION_TIMEOUT

  • What BLE device are you connecting to ? A phone or another nRF52832?

    Is there a disconnect reason on the other BLE device?

    What example in the nRF5 SDK is your application based on?

Related