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

Connection security failed: role: Central in ble_app_rscs_c

Hello,

I am working on nRF52840 DK with nRF5_SDK_15.2.0_9412b96 and I used the example ble_app_rscs_c with absolutely no changes. I first erased the flash and then burned the Softdevice and app to erase any bonding. I used LightBlue on my iPhone to advertise 0x1814 (BLE_UUID_RUNNING_SPEED_AND_CADENCE). The first time I received the pairing request on iPhone. Every time I restart the DK, I receive the following error several times (4 to 5 times):

<info> peer_manager_handler: Connection security failed: role: Central, conn_handle: 0x0, procedure: Encryption, error: 4352

and then

<info> peer_manager_handler: Connection secured: role: Central, conn_handle: 0, procedure: Encryption.

Although it finally works, these failures cause a long delay.  I have also seen this problem reported for BLE peripheral examples but their solution (un-pairing from iPhone) does not work for me. I need to keep the devices paired.

I was wondering how I can fix this.

Thanks,

  • Hi, I did so and the problem is still there. 

  • I'm also having this issue, in my case, the application is based on the multirole example. When acting as a central, it scans and found a peripheral that was already bonded before. The central says that it connected, I'm receiving the PM_EVT_BONDED_PEER_CONNECTED event, and the BLE_GAP_EVT_CONNECTED. I've tested with and without the pm_handler_secure_on_connection call when receiving the PM_EVT_BONDED_PEER_CONNECTED which it will start the Secure connection, when used it doesn't show the PM_EVT_CONN_SEC_START, PM_EVT_CONN_SEC_SUCCEEDED nor PM_EVT_CONN_SEC_CONFIG_REQ.

    I don't know if the problem is related to the primary service discovery which is showing me the following logs:
    [16:17:34:791] <debug> ble_db_disc: Starting discovery of service with UUID 0xFF80 on connection handle 0x0.
    [16:17:34:791] <debug> nrf_ble_gq: Adding item to the request queue
    [16:17:34:796] <debug> nrf_ble_gq: GATTC Primary Services Discovery Request
    [16:17:34:796] <debug> nrf_ble_gq: SD is currently busy. The GATT request procedure will be attempted again later.
    [16:17:34:802] <debug> nrf_ble_gq: Processing the request queue...
    [16:17:34:802] <debug> nrf_ble_gq: GATTC Primary Service Discovery Request
    [16:17:34:802] <debug> nrf_ble_gq: SD is currently busy. The GATT request procedure will be attempted again later.

    It disconnects before completing the primary service discovery request

    Even if I'm not securing the connection I see this log:
    <info> peer_manager_handler: Connection security failed: role: Central, conn_handle: 0x0, procedure: Encryption, error: 4352

    I've tracked the event up to sm_ble_evt_handler of the security manager, however this event is fired by the Softdevice when calling the ble_evt_handler registered by the peer_manager

    Another thing I've noticed is that when debugging the peripheral side I can't see any event of BLE_GAP_EVT_CONNECTED nor PM_EVT_BONDED_PEER_CONNECTED even when the central device is showing me those events. It's like the Central device is receiving false BLE_GAP_EVT_CONNECTED events from the softdevice and it's not sending any actual connection packets to the peripheral

    I've tried with both scan_parameter.extended =1 and =0 and it's the same, no BLE_GAP_EVT_CONNECTED event on the peripheral


    I'm using nrf52832, SDK 16.0.0, Softdevice s132 7.0.1

    It's important to note that after a mass erase on the central, the peripheral connects perfectly (after deleting bonds on the peripheral) but after several successful connection, the problem starts and it never connect again.

  • Hi,

    This thread is over a year old, I suggest you open a new ticket for your case and this issue will be handled there.

Related