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

fds write data before sleep

Hi community,

Try use FDS to write some data before sleep.

Following example and test is work.

But I try write data before into

sd_power_system_off();

and it not work. Then I try create app_timer count down with idle time come. Not work too.

How do I write data before into sleep mode?

Parents
  • Hi,

    Could you explain in more details what is not working? Is the data not written to flash, is an error code returned, etc.? This is copyed from the documentation:

    Initialization, like all other operations in FDS that involve writing or erasing flash memory, is an asynchronous operation. Completion of the operation is reported to the application through a callback.

    Before going to sleep, you should wait for the event in the event handler corresponding to the last FDS operation. The relevant events are defined in fds_evt_id_t.

    If you make a call to fds_record_write(), you should wait for the FDS_EVT_WRITE event before going to sleep.

    Best regards,

    Jørgen

Reply
  • Hi,

    Could you explain in more details what is not working? Is the data not written to flash, is an error code returned, etc.? This is copyed from the documentation:

    Initialization, like all other operations in FDS that involve writing or erasing flash memory, is an asynchronous operation. Completion of the operation is reported to the application through a callback.

    Before going to sleep, you should wait for the event in the event handler corresponding to the last FDS operation. The relevant events are defined in fds_evt_id_t.

    If you make a call to fds_record_write(), you should wait for the FDS_EVT_WRITE event before going to sleep.

    Best regards,

    Jørgen

Children
Related