Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Bonding & Connection Error

Currently, we are testing Bonding & Connect.

Please see the attached log below.

If Click 「Bond」 on Android App (nRF Connect), disconnection occurs after "PM_EVT_CONN_SEC_SUCCEEDED" as shown below, and fast advertisement with whiterliset.
This is similar to the other Project (ble_app_hids_keyboard) logs.But why does disconnection occur?(This is question 1.)

And If Click 「Connect」 on the Android App (nRF Connect),DIsconnection occurs with 0x3D.
Why is this happening? (This is Question 2.)
And please let me know how you can solve it.

<Log>

0> <info> app: BLE_ADV_EVT_WHITELIST_REQUEST
0> <info> app: pm_whitelist_get returns 0 addr in whitelist and 0 irk whitelist
0> <info> app: Fast advertising.
0> <info> app: Connected.
0> <info> app: PM_EVT_CONN_SEC_START
0> <info> app: PM_EVT_CONN_SEC_PARAMS_REQ
0> <info> app: PM_EVT_CONN_SEC_SUCCEEDED
0> <info> app: Connection secured: role: 1, conn_handle: 0x0, procedure: 1, peer_id:0
0> <info> app: PM_EVT_PEER_DATA_UPDATE_SUCCEEDED
0> <info> app: New Bond, add the peer to the whitelist if possible
0> <info> app: m_whitelist_peer_cnt 1, MAX_PEERS_WLIST 8
0> <info> app: PM_EVT_PEER_DATA_UPDATE_SUCCEEDED
0> <info> app: PM_EVT_PEER_DATA_UPDATE_SUCCEEDED
0> <info> app: Disconnected.                                                               <--------- Question Number 1
0> <info> app: Reason:0x13
0>
0> <info> app: BLE_ADV_EVT_WHITELIST_REQUEST
0> <info> app: pm_whitelist_get returns 1 addr in whitelist and 1 irk whitelist
0> <info> app: Fast advertising with whitelist.
0> <info> app: advertising_start false
0>
0> <info> app: Connected.
0> <info> app: Connected to a previously bonded device.
0> <info> app: PM_EVT_LOCAL_DB_CACHE_APPLIED
0> <info> app: PM_EVT_CONN_SEC_START
0> <info> app: Disconnected.                                                              <--------- Question Number 2
0> <info> app: Reason:0x3D
0>
0> <info> app: BLE_ADV_EVT_WHITELIST_REQUEST
0> <info> app: pm_whitelist_get returns 1 addr in whitelist and 1 irk whitelist
0> <info> app: Fast advertising with whitelist.
0> <info> app: advertising_start false

Parents Reply Children
  • Hi,

    Thank you for your reply.

    1) I know the meaning of BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION.
    We know that this BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION occurs immediately after the Bonding happens in the other examples as well.
    So this part looks normal, but what I want to know is why this sequence happens.
    I hope the intention of my question is well communicated.

    2) Although the connection terminated due to MIC failure seems to be a problem,
    We are not touching the encryption keys because we use the bonding parameter as follows (we know that the encryption keys are mutually exchanged information when they are bonded).
    It is also irrelevant to Bonding Erase.
    This is because nrfjprog writes all new flash writes.


    #define SEC_PARAM_BOND 1 // Perform bonding.
    #define SEC_PARAM_MITM 0 // Man In The Middle protection not required.
    #define SEC_PARAM_LESC 0 // Enable LE Secure Connection pairing.
    #define SEC_PARAM_KEYPRESS 0 // Enable generation of keypress notifications.
    #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


    Please let me know if you have any other guesses.

  • Hi,

    Unfortunately, the generic “remote user terminated connection” code does not give much information about why the mobile decided to disconnect.

    A sniffer trace might give us some more information about what is going on. If you have an extra nRF5 DK or dongle, you can use nRF Sniffer to capture a sniffer log. I recommend using the 2.0.0-1.beta version. 

    You should also check if you get any information in the nRFConnect log on the mobile side.

Related