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

NRF52 BLE connection terminiated by Apple device after reconnect

Hi Nordic,

I am using NRF52832/NRF52840 SDK 15.0 to design products. And I found a strange problem that the connection will be terminated by iOS device when connection reconnect. The details steps are:

Step 1:  iOS phone connect NRF52 and pairing with it, and then turn of bluetooth on iOS device. 

Step 2:  Another phone (iOS or Android) connect with the same NRF52 and pairing with it, then turn of the bluetooth on the phone.

Step 3: Use the first iOS phone to connect the same NRF52, the connection will be terminated by the phone (the disconnect reason is 0x13) in  a few seconds after the time point of the BLE link connected.

If the first phone is Android device, there will be no same problem. 

Here is my configuration in the code:

1 Enable repairing

pm_conn_sec_config_t conn_sec_config = {.allow_repairing = true};
pm_conn_sec_config_reply(p_evt->conn_handle, &conn_sec_config);

2 Disable whitelist

3 Detail of secure parameters:

#define SEC_PARAM_BOND 1 /**< Perform bonding. */
#define SEC_PARAM_MITM 0 /**< Man In The Middle protection not required. */
#define SEC_PARAM_LESC 0 /**< LE Secure Connections not enabled. */
#define SEC_PARAM_KEYPRESS 0 /**< Keypress notifications not enabled. */
#define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_NONE /**< No I/O capabilities. */
#define SEC_PARAM_OOB 0 /**< Out Of Band data not available. */
#define SEC_PARAM_MIN_KEY_SIZE 7 /**< Minimum encryption key size. */
#define SEC_PARAM_MAX_KEY_SIZE 16 /**< Maximum encryption key size. */

Any ideas?

Parents Reply Children
  • Hi Einar,

    In fact, I want to find an example to that allow multiple phones to connect with nRF with pairing and bonding in SDK15.0 by using BLE_GAP_IO_CAPS_NONE.  And also permit repairing with the the phone device that already pairing with it. But I don't know which example can meet my requirment. Maybe the problem is caused by my wrong modifications to the ble_app_ancs_c example.

  • Hi,

    I see. From the behavior you described in the initial question and what you wrote now, it seems to me that you have not enabled repairing, and that is why you get the disconnect with reason 0x13.

    The only thing you need to do to allow repairing is to adjust the handling of the PM_EVT_CONN_SEC_CONFIG_REQ (refer to most SDK BLE peripheral examples) so that you set .allow_repairing = true.

    There is nothing specific you need to do to allow multiple phones to bond with the nRF other then reserving enough FDS pages to hold the bonding data (the default configuration of 2 pages plus 1 swap page is probably enough unless you need a very high number?).

Related