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

  • Hi Jørgen,

    I can compile well and flash to board is fine.

    But when run to idle prepare to sleep is hang in there. I put the fds_record_write() into sleep_mode_enter() to write data.

    I could get work if I put fds_record_write() in main(). But I try to make write data before sleep to update last data.

    I also try to put fds_record_write() data app_timer_create() to count down every seconds to write. But it just stop there.

Reply Children
No Data
Related