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

fds_init() returns FDS_ERR_NO_PAGES

SDK 14.2

i just added peer manager to an existing project, and peer manager seems to be working correctly.  pm_peer_data_app_data_store() is successfully called to save addition info to bonds and all bonds persist as they should.  however DFU no longer works.

After DFU completes and reboots into the app, fds_init() returns 11 FDS_ERR_NO_PAGES.

I have been using FDS to save data for some time and never had any issues with FDS before.  Prior to adding peer manager the boot loader was working well.

Here are the FDS settings from sdkconfig.h

#define FDS_VIRTUAL_PAGES 50

#define FDS_VIRTUAL_PAGE_SIZE 1024

#define FDS_BACKEND 2

The boot loader is not using bonds.

It looks like calling both fds_init() and peer manger causes two FDS_EVT_INIT events to be sent to the fds_evt_handler() in the working case (before DFU).

After DFU FDS never gets that far.

Is there a preferred order of initialization for fds_init() and peer manger init?

Is there a graceful way to recover from FDS_ERR_NO_PAGES?

Why does FDS not work after a DFU?

Thanks

  • Hi,

    It's recommended to register all fds users before calling fds_init(). But it's probably not related to the issue you're seeing. I think the problem here is that some of the FDS pages became overwritten during the DFU process and that FDS fails to re-claim those pages on subsequent boot.

    Is it an option to delete all FDS pages when you get this error? You will lose all data in that case. Another option is to enforce single bank updates of application images which should prevent the new app image from overwriting your app data. Depending on the app size and available flash, it should be enough to change the DFU_APP_DATA_RESERVED define in your bootloader to 50 pages. 

  • Thank for your quick response.

    The issue was that DFU_APP_DATA_RESERVED was not set and it was using the default.

Related