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

Bonded phone with iOS 13.4 unable to connect to the nRF52 with deleted bonding information

Hello there,

We faced the new issue after the iPhones are updated to the iOS 13.4. I tried to find the issue solving on the forum and looks like it is the new one.

We have the following environment:

  1. MCU nRF52832
  2. nRF SDK 13.1
  3. SoftDevice nRF52 s132 4.0.5

The issue can be reproduced as follows:

  1. Pair and bond the iPhone with the device.
  2. Delete the peer information from the device.
  3. Attempt to connect the iPhone to the device.

Before the iPhone was updated to the iOS 13.4 all works fine, the repairing process is started, peer data updated on the iPhone. For now the iPhone is not able to finish the connection process, it shows the error: "Peer removed pairing information".

I performed some debugging and can see that from starting of connection to fail the device handles 3 ble events (p_ble_evt->header.evt_id):

16 - BLE_GAP_EVT_CONNECTED

20 - BLE_GAP_EVT_SEC_INFO_REQUEST

17 - BLE_GAP_EVT_DISCONNECTED

I debugged the handler with evt_id = 20 and can see, that the peer manager does not find the peer, sends reply and starts security process (source code bellow marked green):

    // All return values from the following can be safely ignored.
    err_code = sd_ble_gap_sec_info_reply(p_gap_evt->conn_handle, p_enc_info, NULL, NULL);

    if (err_code != NRF_SUCCESS)
    {
        evt.evt_id                        = SMD_EVT_ERROR_UNEXPECTED;
        evt.params.error_unexpected.error = err_code;

        evt_send(&evt);
    }
    else if (p_enc_info == NULL)
    {
        evt.evt_id                                  = SMD_EVT_LINK_ENCRYPTION_FAILED;
        evt.params.link_encryption_failed.error     = PM_CONN_SEC_ERROR_PIN_OR_KEY_MISSING;
        evt.params.link_encryption_failed.error_src = BLE_GAP_SEC_STATUS_SOURCE_LOCAL;

        evt_send(&evt);

        sec_proc_start(p_gap_evt->conn_handle, peer_id, false, false, false);
    }
    else
    {
        sec_start_send(p_gap_evt->conn_handle, PM_LINK_SECURED_PROCEDURE_ENCRYPTION);

        sec_proc_start(p_gap_evt->conn_handle, peer_id, err_code == NRF_SUCCESS, false, false);
    }

The next event we got the disconnection event.

For now we are not able affect this behavior somehow from the device and phone sides. The only possible solution is to go to the BL settings on the phone and forget the device. It is not good way - the best way to handle this without the user interaction.

Probalby you already have a solution how to handle this without the user interaction. Can you, please, help with solving this issue?

Related