![]() |
nRF Connect SDK Bare Metal API 2.0.99
|
| int bm_storage_erase | ( | const struct bm_storage * | storage, |
| uint32_t | addr, | ||
| uint32_t | len, | ||
| void * | ctx ) |
#include <bm_storage.h>
Erase data from storage.
If bm_storage_info::is_erase_before_write is set, the erase address and length must be aligned to the backend's erase unit.
If bm_storage_info::is_erase_before_write is not set, the erase address and length must be aligned to the backend's program unit, or to the backend's wear unit if bm_storage_config::is_wear_aligned is set.
| [in] | storage | Storage instance to erase data in. |
| [in] | addr | Offset within the partition where to erase the data. |
| [in] | len | Length of the data to be erased (in bytes). |
| [in] | ctx | User-defined context sent to the event handler. |
| 0 | on success. |
| -EFAULT | The storage instance storage is NULL. |
| -EPERM | The storage instance storage is not initialized. |
| -EINVAL | The addr or len parameters are unaligned. |
| -ENOMEM | Out of memory to perform the requested operation. |
| -EBUSY | The operation could not be accepted at this time. |
| -EIO | An internal error has occurred. |