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 error handling

I'm testing this with SDK 15.2 on an NRF52832, with SD132.

I'm trying to implement error handling for FDS, but some cases are not clear to me how to deal with them.

Am I correct to assume that:

1) If fds_record_open() fails, I don't have to call fds_record_close().

2) If the CRC of a record is incorrect, i have to remove it myself, it doesn't get removed by GC.

3) The bool "is_record_updated" in the write event is just to differentiate between a call to fds_record_write() and fds_record_update().

And then I was wondering:

4) What errors can be expected in the events? Each function has a nice list of return codes, but not a list of return codes in the event result.

  • 1) Yes.

    2) That is correct. The GC only checks the record_id to see if a record is deleted (dirty) or not. There is some information here and here. The last one describes how to enable CRC check on read and write, but it doesn't have any impact on fds_gc(). Typically, these events are used to wait for the event. The function calls, such as fds_write() will typically be the part that returns an error != NRF_SUCCESS;

    3) Yes. 

    4) Yes. Unfortunately. The results should be described in the fds.h, on line 85-100 (in SDK15.3.0). Unfortunately, I don't know what events results that are possible and not in the different events.

    Best regards,

    Edvin

Related