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

◆ psa_ps_create()

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.

Parameters
[in]uidThe uid value
[in]capacityThe capacity to be allocated in bytes
[in]create_flagsFlags indicating properties of storage
Returns
A status indicating the success/failure of the operation
Return values
PSA_SUCCESSThe operation completed successfully
PSA_ERROR_STORAGE_FAILUREThe operation failed because the physical storage has failed (Fatal error)
PSA_ERROR_INSUFFICIENT_STORAGEThe operation failed because the capacity is bigger than the current available space
PSA_ERROR_NOT_SUPPORTEDThe operation failed because the function is not implemented or one or more create_flags are not supported.
PSA_ERROR_INVALID_ARGUMENTThe operation failed because uid was 0 or create_flags specified flags that are not defined in the API.
PSA_ERROR_GENERIC_ERRORThe operation failed due to an unspecified error
PSA_ERROR_ALREADY_EXISTSStorage for the specified uid already exists