Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

NO_PAGES error at fds pages_init() after boot: how to avoid it and how to recover from it?

Hi there,

Thanks in advance for your time and attention.

We started to see some cases where our devices boots and gets a NO_PAGES error after having been turned off(or at very low power) for a while. The scenario is a battery discharge.

I was wondering if you had any countermeasure the device could take at runtime to recover from it.

Moreover, if you have any insight in how it could happen that would be much appreciated. 

Some months ago we enlarged the flash size of the fds, from 3 to 4 pages to allow for more space(we were getting NO_SWAP errors).
We have:

PeerManager enabled, which takes 1 page from the data section I believe.
3 files, in which there are a few records.

Device: NRF52832
SDK: 15.3.0
Softdevice: S140

Kind regards,
Andrea

  • Hi Andrea, 

    1. Yes the modification will enter in effect after the DFU update. However, if you decrease the number of pages , fds may run into a problem that it couldn't find the swap page. For increasing it might be OK. The best way of doing it when you change the configuration of fds is to reinitialize the pages as you did in the workaround. 

    2. The fds will use all pages to store the 3 files. It doesn't matter if you have 3 files or 1 file, or if you have 3 page or 10 pages. All the flash area will be utilized to store data. It can start first with one single page, but other pages will be used when you update the data a long the road. 

    The reason for that is to avoid flash wear out, all pages configured for fds will be used. Every time you update the file, a new record of the file will be stored in the blank area. And this process continues when you update your files. So after a while all pages will be used. When there isn't any blank area left, garbage collection will be executed and the previous records (marked as old) will be erased. 

Related