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

The connection security fails from the peripheral side

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: 1
00> <info> peer_manager_handler: Error (decoded): BLE_GAP_SEC_STATUS 0x1
00> <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.

case BLE_GAP_EVT_CONN_PARAM_UPDATE_REQUEST:
        {
            // Accept parameters requested by peer.
            err_code = sd_ble_gap_conn_param_update(p_gap_evt->conn_handle&p_gap_evt->params.conn_param_update_request.conn_params);
            APP_ERROR_CHECK(err_code);
        } break;
Parents Reply Children
Related