Hello,
i am developing on nRF52840 using SDK 15.2.0 and Softdevice 6.1.1.
I recently noticed, that when i first bond with the nRF52840, then disconnect and delete the bond from the mobile device, the device can no longer establish a secure connection, instead giving me the following error:
<info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Bonding, error: 133
The mobile device side (using nRF Connect) gives the following message:
Error 22 (0x16): GATT CONN TERMINATE LOCAL HOST.
My security settings on the nRF52840 are as follows:
#define SEC_PARAM_TIMEOUT 5 /**< Time-out for pairing request or security request (in seconds). */
#define SEC_PARAM_BOND 1 /**< Perform bonding. */
#define SEC_PARAM_MITM 0 /**< Man In The Middle protection requirement. */
#define SEC_PARAM_LESC 0 /**< LE Secure Connections enabled. */
#define SEC_PARAM_KEYPRESS 0 /**< Keypress notifications not enabled. */
#define SEC_PARAM_IO_CAPABILITIES BLE_GAP_IO_CAPS_NONE /**< I/O capabilities. */
#define SEC_PARAM_OOB 0 /**< Out Of Band data availability. */
#define SEC_PARAM_MIN_KEY_SIZE 7 /**< Minimum encryption key size. */
#define SEC_PARAM_MAX_KEY_SIZE 16 /**< Maximum encryption key size. */
When bonding a new device, everything works OK. Also in the case of the mobile having been paired but the pairing info being lost on the nRF52840, everything works.
It is only this case where mobile side has deleted the bond which causes an issue.
Any suggestions on how to proceed?
BR,
tommi