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

Peer Manager, Bonding, full storage

Hi together, I'm using nrf52832, SDK 12.1.0 and S132 3.1.0.

I integrated the peer manager to my application code and have the following questions concerning the bonding feature in case of a full storage. I'm wondering what happens with new bonding data in case of a full memory:

1.

When I use the function pm_peer_delete (or pm_peers_delete), do I need to call fds_gc in addition to make the memory again available for new bonding data?

Does it make sense, or should I call fds_gc only in case of full memory?

2.

In case of the PM_EVT_STORAGE_FULL event, the example code just calls fds_gc for garbage collection.

In my opinion, this does not guarantee free space for new bonding data, since it's not clear that there is any garbage. Is there another idea?

Maybe removing bonding data of a peer before calling fds_gc?

3.

In case we get new bonding data to be stored and get the PM_EVT_STORAGE_FULL event, then we free some space (see answer of question 2) for the new bonding data.

In this case, will the new bonding data we stored automatically after we freed the space or do I need to get a new bonding request to store the bonding data in the available space?

Thank you in advance.

Parents
  • Hi,

    1. When you delete a peer, the peer is only "marked for deletion". Nothing is deleted in flash until you call fds_gc().

    2. You can check whether there are deleted records in flash, using fds_stat() for instance. If fds_gc() does not free enough space, then the record cannot fit in flash: the flash is full. You have to delete something and run GC.

    3. Peer Manager will re-attempt to store the bond in flash automatically after GC.

    Regards

Reply
  • Hi,

    1. When you delete a peer, the peer is only "marked for deletion". Nothing is deleted in flash until you call fds_gc().

    2. You can check whether there are deleted records in flash, using fds_stat() for instance. If fds_gc() does not free enough space, then the record cannot fit in flash: the flash is full. You have to delete something and run GC.

    3. Peer Manager will re-attempt to store the bond in flash automatically after GC.

    Regards

Children
Related