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.

CC2642R: Cannot reconnect to central after bond erased on the device side

Part Number: CC2642R

Hi All
I used pairing / bonding in a multirole app running on CC2642.
If I connect to a central (Mac OS for instance), pairing and bonding works as expected.
When I reconnect, no issue.

If I erase bonds (mass erase flash for instance) on the peripheral side only, reconnection to the same central fails, and I receive a GAP_LINK_TERMINATED_EVENT with error 13, immediately after the GAP_LINK_ESTABLISHED_EVENT.

If if forget the device on the central side, I can reconnect through pairing / bonding.

I'm using SDK 6.41.0.17

How can this be solved ?

Thanks

  • Hi,

    Thank you for reaching out.

    First of all, the behavior experienced is expected. In general, the devices and stacks out there do not take into account the possibility of devices flash being erased. When the peripheral's Flash is erased, the central basically tries to re-use the bond, but the peripheral fails to do so leading the central to believe the peripheral has been impersonated.
    I expect in this case the central to immediately terminate the connection - this should produce a link terminated reason "LL_STATUS_ERROR_PEER_TERM" on the peripheral side (0x13).

    Note: In case you meant the connection terminates with 0xD this description may not be totally accurate, and a few more things may be at play. But this first "issue" is pretty likely to be there in the first place. 

    Before asking how to fix this, I would suggest to ask whether you should fix it. I understand in a debug environment this issue is annoying, but could you consider leaving the flash region containing the bonding information untouched? With your final design, do you expect the same (i.e. devices' flash to be erased intentionally) to occur?

    In case you want to fix this, two options:

    • always ensure the bonding information is left untouched
    • on the central side ensure the case where the bonding information is lost is properly handled

    I hope this will help,

    Best regards,