This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2541 peripheral code re-bonding when it shouldn't

Other Parts Discussed in Thread: CC2541, CC2640

This is for the CC2541 project, with project build from the simple Peripheral and Central examples.  Our goal is to only allow bonding only in the factory, to not allow re-bonding in the field (though we do need to allow re-connects, of course).

We deleted the GAPBOND_ERASE_ALLBONDS set parameter that happens when pairing and bonding fails (two in simpleBLEPeripheral.c, one in the shared gapbondmgr.c, and two in simpleBLECentral.c). GAPBOND_ERASE_SINGLEBOND is not used.

For the Central, that was enough. Here are the device bond states (erased or bonded) and the results when we combine them:

    Peripheral       Central        Result

    Erased            Erased         Bonded (good)

    Bonded           Bonded        Re-bonded (good)

    Erased            Bonded        Fail (good)

    Bonded           Erased         Re-bonded (bad, wanted a fail)

So, the peripheral will re-bond even when it shouldn't. We've tried many things but can't seem to get it to stop re-bonding. We have GAPBOND_AUTO_SYNC_WL set to TRUE. When we set it to false, we can't re-bond in the Bonded-Bonded re-connection case.

Do you have suggestions for how to get the peripheral to stop re-bonding?

Additional information about the settings that might be relevant:

  • GAPBOND_PAIRING_MODE: GAPBOND_PAIRING_MODE_INITIATE
  • GAPBOND_MITM_PROTECTION : TRUE
  • GAPBOND_IO_CAPABILITIES : GAPBOND_IO_CAP_DISPLAY_ONLY (peripheral)
  • GAPBOND_BONDING_ENABLED : TRUE
  • GAPBOND_AUTO_SYNC_WL : TRUE

 Thanks!