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

nRF52810 paring bonding

I use the template for pairing and binding. For the first time, after binding, for the second time, I bind again, prompting to reject binding. How can I match and bind many times, thank you!

  • Hi

    Are you using the ble_app_template example in the nRF5 SDK, which version of the SDK are you using? Are you saying that you connect and pair to a device successfully once, and then disconnecting from that device and trying to pair with it again?

    If you delete the bonding information on the nRFConnect side the bonding information will still be present on the nRF52 device, which might be what you're seeing here. To resolve this, you have to delete the bonding information on the nRF somehow. The most straightforward way is to erase the whole flash on the chip by using the nRF Command line Tool nrfjprog --eraseall, but this is not very smooth as you'll have to flash the application onto the device again after the fact.

    Most of our example projects lets you erase bonding information by pressing a button, but you can also do this upon a disconnected event by calling the erase_bonds; function (see code snippet below).

    case BLE_GAP_EVT_DISCONNECTED:
            {
                bool erase_bonds;
                NRF_LOG_INFO("Disconnected.");
                
                advertising_start(erase_bonds); //added by AUAK
                
                break;
            }

    Best regards,

    Simon

  • hi, Simonr

    I see what you mean. After the first binding between the device and the app, the app will be unbound. If you want to bind multiple times, the device will reject it.

    I mean, after the app clicks delete bind, click bind again to bind? It is not to call advertising after disconnection_ start(erase_ Bonds); function

Related