I have set up 2 nrf52 dev kits: one central and one peripheral. The peripheral side hits the PM_EVT_CONN_SEC_FAILED event about 30 seconds after the connection was established. I have set a static passkey on the peripheral side and that passkey is hardcoded on the central side and it will reply with sd_ble_gap_auth_key_reply once BLE_GAP_EVT_AUTH_KEY_REQUEST event is fired.
When I tested the same scenario without using any security that error doesn't occur.
Below are the log messages I got for that instance.
00> <info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x2, procedure: Bonding, error: 100> <info> peer_manager_handler: Error (decoded): BLE_GAP_SEC_STATUS 0x100> <info> app: BLE_GAP_EVT_AUTH_STATUS: status=0x1 bond=0x0 lv4: 0 kdist_own:0x0 kdist_peer:0x0
I am following the procedure shown under, in the central side for connection parameter update requests. I'm using nrf52832 with softdevice 16.0.0. TIA.
The error corresponds to 'BLE_GAP_SEC_STATUS_TIMEOUT' indicating one of the requests has timed out. Does the peripheral support multiple connections since the connection handle is equal to 2 in the log you posted? I can try and debug it here if you are able to share your projects.
My project supports multiple connections and as well as the same device is supposed to support both central and peripheral roles at the same time.
Ok, thanks for confirming. Have you verified that the BLE_GAP_EVT_AUTH_KEY_REQUEST event gets triggered and that the call to sd_ble_gap_auth_key_reply() returns NRF_SUCCESS as well?