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: How to debug BT connection failed issue

Part Number: CC2340R5


Dear TI Member,

Recently, our team encountered an issue where a Bluetooth (BT) connection failed, and we are keen to find a solution for it.

I am concerned about how to print the BT connection message.

In addition to using LogBuffer in debug mode to verify the BT state, is there another way to check the BT connection state? Simply adding a log in the application layer seems not to help in addressing the problem.

By the way, our device is running in peripheral mode.

The table below is my current building environment:

Software

Version

Code Composer Studio

12.4.0.202306011800

SimpleLink SDK

7.20.1.10

XDCtools

3.62.1.16_core

Best regards,

Zach

  • Hi Zach,

    Thank you for reaching out. Can you clarify how the connection is failing? When a disconnection occurs, a link termination event is received which contains the disconnection reason. This should assist in narrowing in on why the disconnection may be ocurring.

    Best Regards,

    Jan

  • Hi Jan,

    Our device disconnects unexpectedly after being connected for about 30 minutes. Currently, we've no idea about this issue. That's why we are reaching out.

    <<< When a disconnection occurs, a link termination event is received which contains the disconnection reason.

    >>> Is there any way for checking this event?

    Best regards,

    Zach

  • Hi Zach,

    If you are working on basic_ble or data_strea, then you can find within the app_connection.c the Connection_ConnEventHandler() function. Within this function, there is a case for BLEAPPUTIL_LINK_TERMINATED_EVENT. This event will also provide the disconnection reason within apTermMsg->reason. This reason can be used to further determine what may have caused the disconnection.

    Best Regards,

    Jan

  • Hi Jan,

    Thank you for the suggestion regarding the Connection_ConnEventHandler() function.

    I'm interested in exploring ways to monitor Bluetooth status via logs without modifying existing code.

    Our goal is to maintain a clean and unchanged codebase. Do you know of any methods to achieve this?

    Best regards,

    Zach

  • Hi Zach,

    At this time, I don't believe there is a way to log BLE events without adding some additional code. That said, we do have a log driver than may be useful here. It allows you to log information through the debugger while the device is running which may implement the functionality you are looking for. You could also pair this with #ifdef statements to remove it during production and include it during testing.

    Best Regards,

    Jan