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

FDS_ERR_NOT_FOUND after two fds_record_update calls fast after eachother

I am using the FDS library to write a struct to flash. Lately I sometimes  get  FDS_ERR_NOT_FOUND in the event handler as a result of a fds_record_update call.

I've only seen this happen when two update happen right after eachother.  Most of the times this goes well, but when it doesn't the first one always succeeds and the second gives FDS_ERR_NOT_FOUND.

Has anyone experienced this kind of behaviour?

I am using SDK 14.2 and softdevice S332

Parents Reply Children
  • The error is returned in function write_execute in fds.c

    switch (p_op->write.step)
    {
    case FDS_OP_WRITE_FIND_RECORD:
    {
    // The first step of updating a record constists of locating the copy to be deleted.
    // If the old copy couldn't be found for any reason then the update should fail.
    // This prevents duplicates when queuing multiple updates of the same record.
    desc.p_record = NULL;
    desc.record_id = p_op->write.record_to_delete;

    if (!record_find_by_desc(&desc, &page))
    {
    return FDS_ERR_NOT_FOUND;
    }

    stacktrace:
    }

  • Hi Gert,

    Sorry for the late response. We need some more debug information, for example checking why record_find_by_desc() return not found. There must be something happened in between the 2 updates. 

    How often do you see the error ? Is it easy to reproduce ? Anyway that we can reproduce the issue here ? 

    If you can printout more log from record_find_by_desc() it would be very useful. 

Related