Please tell me what to do when FDS_ERR_NO_SPACE_IN_FLASH occurs.

Hello.

I am developing using nrf52832 (S132 v7.0.1, SDK v17.0.0).

I am reading and writing data using FDS.
If you execute fds_record_update at that time, the error of FDS_ERR_NO_SPACE_IN_FLASH will occur.
I think this is because Flash has run out of free space but cannot be updated and an error has occurred.
I'm updating using the same file ID and record key, but isn't the old data released?
I think you can use fds_gc to release old data, but even the bonding data will be released. Is there a way to free only unused data in fds?

Best regards.

  • Hi,

    I'm updating using the same file ID and record key, but isn't the old data released?

    When you update a record, what really happens is that a new record is created and the old (which has been updated) are flagged as dirty. However, both reside in flash and both will consume flash space. In order to reclaim the space you need to do a garbage collection by calling fds_gc().

    I think you can use fds_gc to release old data, but even the bonding data will be released.

    Yes and no. fds_gc() will free up space that has been marked as dirty. That means deleted records, and old records which has been updated. It will not delete records that are currently in use.

    Is there a way to free only unused data in fds?

    Yes, tha tis fds_gc().

Related