Lots of BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED (0x3E) when using PCA10100

Hi,

I'm using a PCA10100 as a central in NRFconnect desktop in order to make connection on my custom peripheral.

I encountered a high rate of  BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED disconnected reason

log_BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED.txt

It is the log of nrf connect, with only one connection successful (line 488).

What could be the cause of this type of error, and why i have as much of error.

My peripheral are using SDK 15.2 with sd s132_nrf52_6.1.0_softdevice.

The advertising period is 2 sec and the connection parameters are 

#define MIN_CONN_INTERVAL_MS            7.5                                         /**< Minimum acceptable connection interval in ms. */
#define MIN_CONN_INTERVAL_UNITS         MSEC_TO_UNITS(MIN_CONN_INTERVAL_MS,UNIT_1_25_MS)

#define MAX_CONN_INTERVAL_MS            30                                          /**< Maximum acceptable connection interval in ms. */
#define MAX_CONN_INTERVAL_UNITS         MSEC_TO_UNITS(MAX_CONN_INTERVAL_MS,UNIT_1_25_MS)

#define SLAVE_LATENCY                   0                                           /**< Slave latency. */

#define CONN_SUP_TIMEOUT_MS             4000                                       /**< Connection supervisory timeout (4 seconds), Supervision Timeout uses 10 ms units. */
#define CONN_SUP_TIMEOUT_UNITS          MSEC_TO_UNITS(CONN_SUP_TIMEOUT_MS, UNIT_10_MS)

Best Regards,

Julien

  • Hi Julien, 

    The return code BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED happens when the central sends a connect request and assuming it's received by the peripheral. It will continue to send connect event packets according to the connection parameters to see if it get any response from the peripheral. After usually 6 packets without any response it will terminate the connection and return BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED . 

    This situation usually happens when the peripheral didn't receive the connect request or ignore it due to accept list (white list). Hence, no response from it to the central. In your case, it occasionally worked so it's more likely that it has something to do with the hardware on your board that the radio doesn't work as it should. 

    Have you tried to verify the behavior with another nRF52 Dev kit ? to see if you have the same BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED report or not ? 

    Do you have any range issue when you test your board with other central, for example a phone ? 

  • Hi Hung,

    No range issue with a phone, but still difficulties to make connection (a lot of Error 133 (0x85): GATT ERROR)

    nRF Connect, 2022-12-22
    KTagCo (EA:BE:11:09:6F:14)
    V	14:27:49.426	Connecting to EA:BE:11:09:6F:14...
    D	14:27:49.426	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	14:27:54.891	[Callback] Connection state changed with status: 133 and new state: DISCONNECTED (0)
    E	14:27:54.892	Error 133 (0x85): GATT ERROR
    I	14:27:54.892	Disconnected
    D	14:27:57.394	gatt.close()
    D	14:27:57.394	wait(200)
    V	14:27:57.595	Connecting to EA:BE:11:09:6F:14...
    D	14:27:57.596	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	14:28:10.918	[Callback] Connection state changed with status: 133 and new state: DISCONNECTED (0)
    E	14:28:10.918	Error 133 (0x85): GATT ERROR
    I	14:28:10.918	Disconnected
    D	14:28:12.955	gatt.close()
    D	14:28:12.956	wait(200)
    V	14:28:13.157	Connecting to EA:BE:11:09:6F:14...
    D	14:28:13.157	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	14:28:14.632	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    D	14:28:14.642	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I	14:28:14.642	Connected to EA:BE:11:09:6F:14
    V	14:28:14.652	Discovering services...
    D	14:28:14.652	gatt.discoverServices()
    I	14:28:15.399	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    D	14:28:15.652	[Callback] Services discovered with status: 0
    I	14:28:15.652	Services discovered
    V	14:28:15.671	Generic Access (0x1800)
    - Device Name [R] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    - Central Address Resolution [R] (0x2AA6)
    Generic Attribute (0x1801)
    - Service Changed [I] (0x2A05)
       Client Characteristic Configuration (0x2902)
    Service Configuration (ef680600-9b35-4933-9b10-52ffa9740042)
    - Porte [R W] (ef680605-9b35-4933-9b10-52ffa9740042)
    - Temperature [R W] (ef680607-9b35-4933-9b10-52ffa9740042)
    - Param [W] (ef680608-9b35-4933-9b10-52ffa9740042)
    Thingy Environment Service (ef680200-9b35-4933-9b10-52ffa9740042)
    - Measurement [I] (ef680210-9b35-4933-9b10-52ffa9740042)
       Client Characteristic Configuration (0x2902)
    - TES INFO [R] (ef68020f-9b35-4933-9b10-52ffa9740042)
    Secure DFU Service (0xFE59)
    - Buttonless DFU [I W] (8ec90003-f315-4f60-9fb8-838830daea50)
       Client Characteristic Configuration (0x2902)
    D	14:28:15.672	gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
    D	14:28:15.674	gatt.setCharacteristicNotification(ef680210-9b35-4933-9b10-52ffa9740042, true)
    I	14:28:15.734	Connection parameters updated (interval: 20.0ms, latency: 0, timeout: 4000ms)
    V	14:28:22.111	Disconnecting...
    D	14:28:22.111	gatt.disconnect()
    D	14:28:22.115	[Callback] Connection state changed with status: 0 and new state: DISCONNECTED (0)
    I	14:28:22.115	Disconnected
    D	14:28:23.138	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    D	14:28:23.142	gatt.close()
    D	14:28:23.143	wait(200)
    V	14:28:23.344	Connecting to EA:BE:11:09:6F:14...
    D	14:28:23.344	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    I	14:28:23.360	Disconnected
    D	14:28:25.441	[Callback] Connection state changed with status: 133 and new state: DISCONNECTED (0)
    E	14:28:25.441	Error 133 (0x85): GATT ERROR
    D	14:28:27.946	gatt.close()
    D	14:28:27.946	wait(200)
    V	14:28:28.147	Connecting to EA:BE:11:09:6F:14...
    D	14:28:28.147	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	14:28:39.486	[Callback] Connection state changed with status: 133 and new state: DISCONNECTED (0)
    E	14:28:39.486	Error 133 (0x85): GATT ERROR
    I	14:28:39.486	Disconnected
    D	14:28:42.716	gatt.close()
    D	14:28:42.716	wait(200)
    V	14:28:42.918	Connecting to EA:BE:11:09:6F:14...
    D	14:28:42.918	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	14:28:43.528	[Callback] Connection state changed with status: 133 and new state: DISCONNECTED (0)
    E	14:28:43.529	Error 133 (0x85): GATT ERROR
    I	14:28:43.529	Disconnected
    

    What is the meaning of this error ?

    Best regards,

    Julien

  • Hi Julien, 

    It's the same as BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED . Error 133 is a generic error number, and many time it's when the connection can't be established as I explained in the last reply. 

    If you still have good range, the clock source either LFCLK or HFCLK could be the issue . Please try to change the configuration to use RC  clock source for the LFCLK if you are using external 32kHz crystal.

  • Hi Hung,

    I am using an external 32 kHz crystal, but cannot use the RC clock source (error 7 when enable softdevice).

    How can i verify the LFCLK or HFCLK?

  • Hi,

    To use the RC oscillator, you must specify a clock calibration interval and change the clock accuracy to 500 ppm. Otherwise, the Softdevice enable call with return with error 7 (invalid param). For this test, I suggest you select the synthesized clock source instead.

Related