Using the 15.2 SDK, the stack generates an error when attempting to bond. I am using the android nRF Connect test app to initiate the bonding after connection. The error generated is NRF_ERROR_INVALID_ADDR in the smd_params_reply() of security_dispatcher.c which occurs from the call sd_ble_gap_sec_params_reply() into the stack. I see sec_keyset_fill() being called and returning without error immediately before the call to sd_ble_gap_sec_params_reply(). The pointers being passed in look valid so I don’t know why the NRF_ERROR_INVALID_ADDR error would be generated.
I used ble_app_hrs as an example. I used the same peer_manager_init() and continued to add source files required to remove all the linking errors. Other than that it looks like it is all unmodified Nordic SDK software that handles the bonding and is failing. The ble_app_hr example looks fairly simple with the peer_maanger_init(). It looks like most of the software required for bonding is done in the added software as the main does not really do anything ether then generate log information:
case BLE_GAP_EVT_SEC_PARAMS_REQUEST:
NRF_LOG_DEBUG("BLE_GAP_EVT_SEC_PARAMS_REQUEST");
break;
case BLE_GAP_EVT_AUTH_KEY_REQUEST:
NRF_LOG_INFO("BLE_GAP_EVT_AUTH_KEY_REQUEST");
break;
case BLE_GAP_EVT_LESC_DHKEY_REQUEST:
NRF_LOG_INFO("BLE_GAP_EVT_LESC_DHKEY_REQUEST");
break;
Has anyone run into this issue when trying to add bonding functionality to their program?