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

FDS not able to write in SDK 14

Dear all,

I'm struggling writing 32 bytes with FDS in SDK 14.

This is what I do:

Init

(void) fds_register(fds_evt_handler);
fds_init();
while(!is_init) {
    sd_app_evt_wait();
}

Write

fds_record_t        record;
fds_record_desc_t   record_desc = {0};

record.file_id              = FILE_ID;
record.key                  = key;
record.data.p_data        = data;
record.data.length_words      =  (length+3)/ sizeof(uint32_t);
fds_record_write(&record_desc, &record);

I do see that the header is written and on next startup fds_stat returns one more dirty record, but fds_evt_handler is never called with FDS_EVT_WRITE. It is called with FDS_EVT_INIT though, so it seems to basically work. I've read in other posts (mostly concerning older SDKs) that one should check that a soc_evt_handler forwards events to fds_evt_handler, but after

NRF_SDH_SOC_OBSERVER(m_soc_observer, APP_SOC_OBSERVER_PRIO, soc_evt_handler, NULL);

soc_evt_handler is never called.

Any help?

Related