Hello, In a product already in the hands of the users we started getting some issues when connecting to Android Devices
Using the nRF Connect Android Application whenever I try to bond the device I get the PM_EVT_CONN_SEC_FAILED error with the BLE_GAP_SEC_STATUS_CONFIRM_VALUE
I'm using SDK 15.0.0_a53641a, the device is a nRF52832
sec_param.bond = SEC_PARAM_BOND;
sec_param.mitm = SEC_PARAM_MITM;
sec_param.lesc = SEC_PARAM_LESC;
sec_param.keypress = SEC_PARAM_KEYPRESS;
sec_param.io_caps = SEC_PARAM_IO_CAPABILITIES;
sec_param.oob = SEC_PARAM_OOB;
sec_param.min_key_size = SEC_PARAM_MIN_KEY_SIZE;
sec_param.max_key_size = SEC_PARAM_MAX_KEY_SIZE;
sec_param.kdist_own.enc = 1;
sec_param.kdist_own.id = 1;
sec_param.kdist_peer.enc = 1;
sec_param.kdist_peer.id = 1;
where:
#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. */
This is the logs I'm getting, I don't know why there's a MTU request, it seems that some android devices are requesting an MTU value as soon it connects
It's important to notice that the bond information on the application was deleted, and every test was made after erasing all the memory of the nRF52832 device.
I've tested with
<info> app: Connected.
<debug> app: Connection event
<debug> nrf_ble_gatt: Peer on connection 0x0 requested a data length of 100 bytes.
<debug> nrf_ble_gatt: Updating data length to 27 on connection 0x0.
<debug> nrf_ble_gatt: Data length updated to 27 on connection 0x0.
<debug> nrf_ble_gatt: max_rx_octets: 27
<debug> nrf_ble_gatt: max_tx_octets: 27
<debug> nrf_ble_gatt: max_rx_time: 912
<debug> nrf_ble_gatt: max_tx_time: 1096
<debug> app: on_conn_params_evt 01
<debug> nrf_ble_gatt: Peer on connection 0x0 requested a data length of 100 bytes.
<debug> nrf_ble_gatt: Updating data length to 27 on connection 0x0.
<debug> nrf_ble_gatt: Data length updated to 27 on connection 0x0.
<debug> nrf_ble_gatt: max_rx_octets: 27
<debug> nrf_ble_gatt: max_tx_octets: 27
<debug> nrf_ble_gatt: max_rx_time: 912
<debug> nrf_ble_gatt: max_tx_time: 1096
<debug> app: on_conn_params_evt 01
<debug> nrf_ble_gatt: Peer on connection 0x0 requested a data length of 100 bytes.
<debug> nrf_ble_gatt: Updating data length to 27 on connection 0x0.
<debug> nrf_ble_gatt: Data length updated to 27 on connection 0x0.
<debug> nrf_ble_gatt: max_rx_octets: 27
<debug> nrf_ble_gatt: max_tx_octets: 27
<debug> nrf_ble_gatt: max_rx_time: 912
<debug> nrf_ble_gatt: max_tx_time: 1096
As soon as I try to bond, I receive the foolowing events:
<debug> app: PM_EVT_CONN_SEC_START
<debug> app: PM_EVT_CONN_SEC_PARAMS_REQ
<debug> app: on_conn_params_evt 01
<debug> app: BLE_GAP_EVT_AUTH_STATUS status 132
<debug> app: err_src 0
<debug> app: bonded 0
<debug> app: lesc 0
<debug> app: sm1_levels lv[1..4] = 0 0 0 0
<debug> app: sm2_levels lv[1..4] = 0 0 0 0
<debug> app: kdist_own: enc,id,sign,link = 0 0 0 0
<debug> app: kdist_own: enc,id,sign,link = 0 0 0 0
<debug> app: PM_EVT_CONN_SEC_FAILED error 0084 error_src 00 procedure 1
<debug> app: sec failed
<info> app: Disconnect
However, when we use the master device which uses a nRF52832 as well as Central device, it connects, pair and bond without any issue
<debug> app: on_conn_params_evt 01
<info> app: Connected.
<debug> app: Connection event
<debug> app: PM_EVT_CONN_SEC_START
<debug> app: PM_EVT_CONN_SEC_PARAMS_REQ
<debug> app: BLE_GAP_EVT_AUTH_STATUS status 0
<debug> app: err_src 0
<debug> app: bonded 1
<debug> app: lesc 0
<debug> app: sm1_levels lv[1..4] = 1 1 0 0
<debug> app: sm2_levels lv[1..4] = 0 0 0 0
<debug> app: kdist_own: enc,id,sign,link = 1 1 0 0
<debug> app: kdist_own: enc,id,sign,link = 1 1 0 0
<debug> app: PM_EVT_CONN_SEC_SUCCEEDED
<debug> app: sec succeed
<info> app: Connection secured: role: 1, conn_handle: 0x0, procedure: 1.
I've checked the following support threads to search answers but I haven't found anything useful
https://devzone.nordicsemi.com/f/nordic-q-a/22242/ble_gap_sec_status_confirm_value-how-menage
https://devzone.nordicsemi.com/f/nordic-q-a/29926/bug-in-peer-manager-in-sdk-14-2/119020#119020
https://devzone.nordicsemi.com/f/nordic-q-a/29811/pm_evt_storage_full-event-spammed
https://devzone.nordicsemi.com/f/nordic-q-a/32677/just-works----confirm-value-failed-when-pairing
https://devzone.nordicsemi.com/f/nordic-q-a/22242/ble_gap_sec_status_confirm_value-how-menage
https://devzone.nordicsemi.com/f/nordic-q-a/16174/error-ble_gap_sec_status_confirm_value
https://devzone.nordicsemi.com/f/nordic-q-a/21781/just-works-example