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

Failed bonding with NRF_ERROR_INVALID_ADDR

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?

Parents
  • Things to check:

    - p_sec_params is valid ptr to app's RAM or flash

    - if LESC selected then p_sec_keyset and both p_sec_keyset->keys_own.p_pk p_sec_keyset->keys_peer.p_pk is valid ptr to app's RAM or flash

    - if bonding is selected:

      -- p_sec_keyset is valid ptr to app's RAM or flash

      -- if LESC selected or own EncKey distribution is selected then p_sec_keyset->keys_own.p_enc_key is valid ptr to app's RAM. Flash address is not accepted.

      -- if LESC not selected and peer EncKey distribution is selected then p_sec_keyset->keys_peer.p_enc_key is valid ptr to app's RAM. Flash address is not accepted.

      -- if own IdKey distribution is selected then p_sec_keyset->keys_own.p_id_key is valid ptr to app's RAM. Flash address is not accepted.

      -- if peer IdKey distribution is selected then p_sec_keyset->keys_peer.p_id_key is valid ptr to app's RAM. Flash address is not accepted.

Reply
  • Things to check:

    - p_sec_params is valid ptr to app's RAM or flash

    - if LESC selected then p_sec_keyset and both p_sec_keyset->keys_own.p_pk p_sec_keyset->keys_peer.p_pk is valid ptr to app's RAM or flash

    - if bonding is selected:

      -- p_sec_keyset is valid ptr to app's RAM or flash

      -- if LESC selected or own EncKey distribution is selected then p_sec_keyset->keys_own.p_enc_key is valid ptr to app's RAM. Flash address is not accepted.

      -- if LESC not selected and peer EncKey distribution is selected then p_sec_keyset->keys_peer.p_enc_key is valid ptr to app's RAM. Flash address is not accepted.

      -- if own IdKey distribution is selected then p_sec_keyset->keys_own.p_id_key is valid ptr to app's RAM. Flash address is not accepted.

      -- if peer IdKey distribution is selected then p_sec_keyset->keys_peer.p_id_key is valid ptr to app's RAM. Flash address is not accepted.

Children
No Data
Related