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 base num

I am starting to use FDS for saving data to flash memory. In the "flash_fds" example the macro APP_ERROR_CHECK() is used to check for errors in most of the function calls, for example 

    rc = fds_stat(&stat);
    APP_ERROR_CHECK(rc);
 

and

    ret_code_t err_code = app_timer_init();
    APP_ERROR_CHECK(err_code);

I now tried using the same type of error handling in my code but recently I ran into an error "0x00000007" which I interpreted as "NRF_ERROR_INVALID_PARAM". But after some investigation I found that I was really seeing the "FDS_ERR_NO_SPACE_IN_FLASH" error.

In fds.h the errors in the "FDS return values." enum overlaps the same error series as the definitions in "nrf_error.h".

I would rather like to see the FDS using some kind of base number, as used in "nrfx_error.h" where NRFX_ERROR_BASE_NUM is defined as 0x0BAD0000 and the rest of the errors are added to this base number.

How would you suggest I solve this in my case?

  • Hi,

    I am happy to report that FDS errors will get a separate NRF_ERROR_FDS_ERR_BASE of 0x8600 in sdk_errors.h, for next release of the SDK.

    From then on, "FDS_ERR_OPERATION_TIMEOUT = NRF_ERROR_FDS_ERR_BASE" in the definition of FDS return values in fds.h, and there is no longer any overlapping error codes.

    Thank you to everyone who have reported this. Your reports are crucial for identifying and fixing issues like this one.

    Regards,
    Terje

Related