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-CC2650: Cannot consistently establish a connection with peripheral devices

Part Number: LAUNCHXL-CC2650
Other Parts Discussed in Thread: CC2650, CC2650STK

Hello everyone,

I am working on a project using the CC2650 launchpad with the BLE SDK 2.2.1.  My project started as the multi-role example from the extra examples github page (github.com/.../ble_examples) but has been modified since then.  I am trying to connect to a SensorTag device to read temperature values.  I use breakpoints for all debugging, I have not been able to set up printing to console and I do not have a packet sniffer.

I never have a problem finding the SensorTag.  I process GAP_DEVICE_INFO_EVENT events until I can find a device with a matching name.  When the GAP_DEVICE_DISCOVERY_EVENT event comes I start a timer for 500ms.  When the timer callback is called I set a global flag then call Semaphore_post(sem) to wake the application thread.  The task function checks the flag and calls GAPRole_EstablishLink with the peer address and address type from the device with a matching name.  In the past I did not have the timer system, GAPRole_EstablishLink was called inside the handler for GAP_DEVICE_DISCOVERY_EVENT.  I have never had problems getting to the point where I call GAPRole_EstablishLink.

The problem is that sometimes nothing seems to happen after I call GAPRole_EstablishLink.  I do not receive GAP_LINK_ESTABLISHED_EVENT or GAP_LINK_TERMINATED_EVENT events and the green LED on the SensorTag continues blinking, indicating that it is still advertising.  When it does work it will work consistently and then suddenly stop I will not be able to get it working again.  Sometimes I find it works better if I start the SensorTag advertising after I start the launchpad scanning.

Thank you in advance for any help you can provide.  I will be happy to provide any additional information required.