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

Quickest simplest way to delete BLE bond infos for test purposes

To the kind attention of Nordic support team,

We would like to delete BLE bond infos, only for test purposes. Being BLE not even activated and softdevice not used. 

For example using a nRF52833 based device in USB mode, and receiving a USB Set Feature that triggers a delete of BLE bond infos,

in a moment where only USB is used and BLE is not activated and softdevice not used. After BLE bond infos deleting command execution, also a reset will do just fine.

Is there a very simple way to do that?

I'm using something like that, but I'm still debugging, I'm not sure that it does work every time correctly:

When appropriate USB Set Feature is received:

void ProtoBle_DeleteBondsFeature()
{

  if(!nrf_sdh_is_enabled())
    ble_stack_init();


  peer_manager_init();
  pm_peers_delete();
}

Anyway, is there a very simple way to delete memory that is reserved for BLE bond infos.

May you please point me out to the right documentation about this memory location please? It would be very much appreciated.

Thank you for your precious help,

Best regards 

Parents Reply
  • Thank you very much, so bonding infos are stored starting from BOOTLOADER_START_ADDR and going down there (the flash sector that comes before the bootloader)? Is it possible to delete as normal flash in case we want to delete all bond infos only for test purposes? Why is it convenient to use pm_peers_delete? Is there any info how bonding infos are structured in memory? Is it part of BLE specifications? Is there a way you suggest, like a tool to directly read and encode those infos? Any special command in nrfjprog so to interact with bonding infos?

    Why should we use 

    pm_peers_delete instead of a simple flash sector erase?
    I managed to use  pm_peers_delete successfully. But after doing another bonding, I cannot delete bond infos anymore, when calling pm_peers_delete again  ( every time a usb set feature command has been sent so to trigger pm_peers_delete )

    Thank you

Children
  • Bonding infos are saved in normal flash. It is simple to find out where using all great tools Nordic provide. For example it is possible to like a diff using nRFConnect and the 'Program' utility to visually show memory areas and comparing memory areas length before and after doing a bonding. So it is definitely normal flash and can be erased with normal flash routines. the advantage in using pm_peers_delete() should be related to the fact that it uses a sophisticated flash memory handling, able to treat flash as a file system and to selectively delete/invalidate the smallest amount of flash possible. So that it is good also for flash life. This is what I understood  

Related