nRF Connect SDK API 2.8.0
|
psa_status_t psa_ps_create | ( | psa_storage_uid_t | uid, |
size_t | capacity, | ||
psa_storage_create_flags_t | create_flags ) |
#include <include/protected_storage.h>
Reserves storage for the specified uid.
Upon success, the capacity of the storage will be capacity, and the size will be 0. It is only necessary to call this function for assets that will be written with the psa_ps_set_extended function. If only the psa_ps_set function is needed, calls to this function are redundant.
[in] | uid | The uid value |
[in] | capacity | The capacity to be allocated in bytes |
[in] | create_flags | Flags indicating properties of storage |
PSA_SUCCESS | The operation completed successfully |
PSA_ERROR_STORAGE_FAILURE | The operation failed because the physical storage has failed (Fatal error) |
PSA_ERROR_INSUFFICIENT_STORAGE | The operation failed because the capacity is bigger than the current available space |
PSA_ERROR_NOT_SUPPORTED | The operation failed because the function is not implemented or one or more create_flags are not supported. |
PSA_ERROR_INVALID_ARGUMENT | The operation failed because uid was 0 or create_flags specified flags that are not defined in the API. |
PSA_ERROR_GENERIC_ERROR | The operation failed due to an unspecified error |
PSA_ERROR_ALREADY_EXISTS | Storage for the specified uid already exists |