nRF Connect SDK Bare Metal API 2.0.99
Loading...
Searching...
No Matches

◆ bm_storage_write()

int bm_storage_write ( const struct bm_storage * storage,
uint32_t dest,
const void * src,
uint32_t len,
void * ctx )

#include <bm_storage.h>

Write data to storage.

The write address and length must be a multiple of the backend's program unit. If bm_storage_config.flags.is_wear_aligned is set, alignment to the wear unit is required instead.

Parameters
[in]storageStorage instance to write data to.
[in]destOffset within the partition where to write the data to.
[in]srcData to be written.
[in]lenLength of the data to be written (in bytes).
[in]ctxUser-defined context sent to the event handler.
Return values
0on success.
-EFAULTThe storage instance storage or src is NULL.
-EPERMThe storage instance storage is not initialized.
-EINVALThe dest or len parameters are unaligned.
-ENOMEMOut of memory to perform the requested operation.
-EBUSYThe operation could not be accepted at this time.
-EIOAn internal error has occurred.