Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

fds_gc() does not skip pages after first usage of FDS

I'm trying to debug issues in my application related to FDS garbage collection.

My application periodically runs fds_gc() from startup. At this point, garbage collection is doing nothing. However, after I call pm_peer_rank_highest() once, fds_gc() appears to garbage-collect the page each time it is run. Adding some debug output to nrf_fstorage_erase(), I see that it is called after every fds_gc() after pm_peer_rank_highest(), and never before. Digging into fds.c, I see where m_pages[].can_gc is set to 'true', but I don't see where it is set to 'false'. Is this a bug?

I'm using nRF SDK 14.2, with Peer Manager and FDS modules backported from SDK 16.

Related