nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches

◆ emds_store()

int emds_store ( void )

#include <include/emds/emds.h>

Start the emergency data storage process.

Triggers the process of storing all data registered to be stored. All data registered either through emds_entry_add function or the EMDS_STATIC_ENTRY_DEFINE macro is stored. It locks all interrupts until the write is finished. Once the data storage is completed, the data should not be changed, and the device should be halted. The device must not be allowed to reboot when operating on a backup supply, since reboot will trigger data load from the EMDS storage and clear the storage area. The reboot should only be allowed when the main power supply is available.

This is a time-critical operation and will be processed as fast as possible. To achieve better time predictability, this function must be called from an interrupt context with the highest priority.

When writing to flash, it bypasses the flash driver. Therefore, when running with MPSL, make sure to uninitialize the MPSL before this function is called. Otherwise, an assertion may be triggered by the exit of the function.

Return values
0Success
-ERRNOerrno code if error