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

S120 Multilink Central app connects, then very quickly disconnects (Reason: BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED)

I have taken the S120 app, and am trying to have it connect to an external peripheral (not the provided S120 Multilink Peripheral app)

The S120 app successfully discovers the peripheral's advertising, and proceeds to establish a connection, and perform service discovery.

But very quickly, the S120 receives a connection disconnect event, with reason code BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED.

Application Log is as follows:

[APPL]:[0x00] >> DM_EVT_CONNECTION
	[APPL]:[BA 49 B1 EB D7 90]: Connection Established

	[APPL]:[CI 0x00]: Requesting GATT client create
	[DB]: Starting discovery of service with UUID 0xffe0 for Connection handle 0
[APPL]:[0x00] << DM_EVT_CONNECTION

[APPL]:[0x00] >> DM_EVT_DISCONNECTION
[APPL]:[0x00] << DM_EVT_DISCONNECTION

No service discovery activites appear to happen because of the immediate disconnect.

At moment of disconnect, I captured the p_event data structure ...

p_event 0x20003f44 event_id 18 event_param {...} p_gap_param 0x20002e48 conn_handle 0 params {...} connected {...} peer_addr {...} addr_type 0x3e addr 0x20002e4b addr[0] 0xba addr[1] 0x49 addr[2] 0xb1 addr[3] 0xeb addr[4] 0xd7 addr[5] 0x90 irk_match 0 irk_match_idx 0 conn_params {...} min_conn_interval 48 max_conn_interval 48 slave_latency 0 conn_sup_timeout 400 disconnected {...} reason 0x3e conn_param_update {...} sec_params_request {...} sec_info_request {...} passkey_display {...} auth_key_request {...} auth_status {...} conn_sec_update {...} timeout {...} rssi_changed {...} adv_report {...} sec_request {...} conn_param_update_request {...}

What is not clear to me is what would cause it to reject a connection request. With my peripheral unit, I am able to connect to it perfectly fine with a tool such as BlueGiga's BLEGUI app.

Any help is appreciated.

  • I used the nRF51 packet sniffer to capture the CONNECT_REQ differences between using the MultiLink Central, and the BlueGiga Central.

    Please see attached Wireshark files.

    Any thoughts would be appreciated.

    Thx

    Wireshark captures.zip

  • Trying to add attachments again ... looks like files have to be either .txt files or .zip files.

  • I am using the S120 Softdevice 1.0 and SDK 5.2 on PCA10001 hardware.

    My observations on the attached Wireshark files:

    See CONNECT_REQ message from Central device S120 Central ( Interval = 75ms Window Size = 6.25 ms, Window Offset = 0 ms ) BLEGUI Central ( Interval = 75ms Window Size = 2.5 ms, Window Offset = 2.5 ms )

    Where the connection fails follows the CONNECT_REQ message from Central device. The "master" (Central device) sends an "Empty Data PDU" link establishment packet to the peripheral.

    With the BLEGUI Central, the "slave" (Peripheral device) proceeds to successfully establish a connection.

    But with the S120 Central, the "slave" (Peripheral device) decides to not respond at all. That is the core reason for the BLE_HCI_CONN_FAILED_TO_BE_ESTABLISHED reason code.

    But I don't understand what the peripheral doesn't like in the S120's Central CONNECT_REQ message ... such that the peripheral does not respond.

    I don't see anywhere in the S120 code where we can control the value of Window Size/Offset ... to see if that may be a reason for the unsuccessful connect negotiation.

    But from what I understand, and in looking at the Wireshark traces, I don't believe Window Size/Offset is the cause of the issue. Likely under control of the SoftDevice. I noticed on packet 13 that the S120 changed the Window Offset to 17.5ms.

    Any experts on low level BLE CONNECT_REQ and link level negotiations ? :)

    Thx

  • Clarification. My original Application Log was when the Interval had been set to 60ms (S120 demo app default). I had changed it to 75ms to match what the BLEGUI Central was using.

    But notice that the Application Log now shows the following:

    [APPL]:[0x00] >> DM_EVT_CONNECTION
    [APPL]:[BA 49 B1 EB D7 90]: Connection Established
    [APPL]:[0x00] << DM_EVT_CONNECTION
    
    [APPL]:[0x01] >> DM_EVT_CONNECTION
    [APPL]:[BA 49 B1 EB D7 90]: Connection Established
    [APPL]:[0x01] << DM_EVT_CONNECTION
    
    [APPL]:[0x00] >> DM_EVT_DISCONNECTION Reason:[0x3E]
    [APPL]:[0x00] << DM_EVT_DISCONNECTION (Peers connected: 1)
    
    [APPL]:[0x01] >> DM_EVT_DISCONNECTION Reason:[0x3E]
    [APPL]:[0x01] << DM_EVT_DISCONNECTION (Peers connected: 0)
    

    This points to some sort of timing issue between Central Peripheral.

    The S120 Central picks up on another Peripheral advertisement, and tries to negotiate a 2nd connection.

  • Hi there,

    Unfortunately you cannot control the window size or offset at this time. Regarding the 0x3E failure to connect, I will escalate this internally and see where the issue lies. Thanks for the Wireshark captures, those should be helpful.

    EDIT: A couple of questions:

    What version of the 1.0.0 SD are you using? 1.0.0-1.alpha or 1.0.0-2.alpha? Can you reproduce the issue consistently, or does it happen randomly?

    Thanks,

    Carles

Related