Infineon MOTIX™ MCU TLE988x/9x Device Family SDK
Data Structures | Macros | Typedefs | Enumerations
BOOTROM_api

Detailed Description

Data Structures

struct  user_100tp_read_t
 
struct  user_100tp_write_t
 
struct  user_key_t
 Key data structure aligned with CFS page (ignored reserved bytes) More...
 
struct  user_crypto_inp_buf_t
 
struct  user_crypto_out_buf_t
 
struct  user_crypto_io_buf_t
 
struct  user_crypto_cmac_t
 
struct  user_crypto_cbc_t
 
struct  user_key_write_params_t
 
struct  user_key_write_t
 
struct  user_key_erase_params_t
 
struct  user_key_erase_t
 
struct  user_nvm_page_write_t
 

Macros

#define addr_user_nvm_isr_handler   (0xc1u)
 
#define addr_user_cid_get   (0xc5u)
 
#define addr_user_ram_mbist   (0xc9u)
 
#define addr_user_nvm_udata_temp_protect_clear   (0xd1u)
 
#define addr_user_nvm_ucode_temp_protect_clear   (0xd5u)
 
#define addr_user_nvm_udata_temp_protect_set   (0xd9u)
 
#define addr_user_nvm_ucode_temp_protect_set   (0xddu)
 
#define addr_user_nvm_temp_protect_get   (0xe1u)
 
#define addr_user_nvm_ecc_addr_get   (0xe5u)
 
#define addr_user_nvm_ecc_check   (0xe9u)
 
#define addr_user_nvm_100tp_read   (0xedu)
 
#define addr_user_nvm_100tp_write   (0xf1u)
 
#define addr_user_nvm_100tp_erase   (0xf5u)
 
#define addr_user_nvm_config_get   (0xf9u)
 
#define addr_user_nvm_page_erase   (0xfdu)
 
#define addr_user_nvm_sector_erase   (0x101u)
 
#define addr_user_nvm_page_write   (0x105u)
 
#define addr_user_nvm_mapram_init   (0x109u)
 
#define addr_user_nvm_mapram_recover   (0x10du)
 
#define addr_user_nvm_service_algorithm   (0x111u)
 
#define addr_user_crypto_aes_cmac_generate_start   (0x115u)
 
#define addr_user_crypto_aes_cmac_generate_update   (0x119u)
 
#define addr_user_crypto_aes_cmac_generate_finish   (0x11du)
 
#define addr_user_crypto_aes_cmac_verify_start   (0x121u)
 
#define addr_user_crypto_aes_cmac_verify_update   (0x125u)
 
#define addr_user_crypto_aes_cmac_verify_finish   (0x129u)
 
#define addr_user_crypto_aes_start   (0x12du)
 
#define addr_user_crypto_aes_update   (0x131u)
 
#define addr_user_crypto_aes_finish   (0x135u)
 
#define addr_user_crypto_key_write   (0x139u)
 
#define addr_user_crypto_key_erase   (0x13du)
 
#define addr_user_crypto_key_verify   (0x141u)
 
#define addr_user_nvm_reg_write   (0x145u)
 
#define addr_user_nvm_reg_read   (0x149u)
 
#define addr_user_secure_download_start   (0x14du)
 
#define addr_user_secure_download_update   (0x151u)
 
#define addr_user_secure_download_finish   (0x155u)
 
#define addr_user_cache_operation   (0x159u)
 
#define addr_user_ubsl_size_restore   (0x15du)
 
#define addr_user_nvm_perm_protect_set   (0x161u)
 
#define addr_user_nvm_ubsl_temp_protect_clear   (0x201u)
 
#define addr_user_nvm_ubsl_temp_protect_set   (0x205u)
 
#define addr_user_secure_dualboot   (0x209u)
 
#define USER_KEY_SIZE_128   (0x10u)
 128 bits key length More...
 
#define USER_KEY_SIZE_256   (0x20u)
 256 bits key length More...
 
#define USER_KEY_SIZE_MAX   (USER_KEY_SIZE_256)
 Maximum length for a key value to read/store. More...
 
#define USER_KEY_PARAM_SIZE   (0x40u)
 encrypted key parameter size 64 bytes More...
 
#define USER_CMAC_SIGNATURE_SIZE   (0x10u)
 cmac signature size 16 bytes More...
 
#define USER_KEY_WRITE_BUFFER_SIZE   (0x30u)
 Size of key_write decryption buffer. More...
 
#define USER_KEY_MAX_ID   (12u)
 Maximum User key slot ID. More...
 
#define USER_KEY_MIN_ID   (1u)
 Minimum User key slot ID. More...
 
#define IFX_KEY_ID   (0u)
 IFX key ID. More...
 
#define user_cid_get   ( (int32_t(*)(uint32_t *)) addr_user_cid_get )
 This user API function gets the customer identification number. More...
 
#define user_ram_mbist   ( (int32_t(*)(uint32_t, uint32_t)) addr_user_ram_mbist )
 This user API function performs a MBIST on the specified SRAM range. Start address shall be smaller than end address. More...
 
#define user_nvm_udata_temp_protect_clear   ( (int32_t(*)(uint32_t)) addr_user_nvm_udata_temp_protect_clear )
 This user API function temporarily clears the write protection of the UDATA segment. More...
 
#define user_nvm_ucode_temp_protect_clear   ( (int32_t(*)(uint32_t)) addr_user_nvm_ucode_temp_protect_clear )
 This user API function temporarily clears the write protection of the UCODE segment. More...
 
#define user_nvm_udata_temp_protect_set   ( (int32_t(*)(uint32_t)) addr_user_nvm_udata_temp_protect_set )
 This user API function temporarily sets the write protection of the UDATA segment. More...
 
#define user_nvm_ucode_temp_protect_set   ( (int32_t(*)(uint32_t)) addr_user_nvm_ucode_temp_protect_set )
 This user API function temporarily sets the write protection of the UCODE segment. More...
 
#define user_nvm_temp_protect_get   ( (uint32_t(*)(user_nvm_segment_t)) addr_user_nvm_temp_protect_get )
 This user API function gets the current protection status of a specified NVM segment. More...
 
#define user_nvm_perm_protect_set   ( (int32_t(*)(uint32_t)) addr_user_nvm_perm_protect_set )
 This user API function sets permanent protection on NVM segments. More...
 
#define user_nvm_ecc_addr_get   ( (int32_t(*)(uint32_t, uint32_t *)) addr_user_nvm_ecc_addr_get )
 This user API function returns the address of a double ECC event that has occurred in the target flash. More...
 
#define user_nvm_ecc_check   ( (int32_t(*)(uint32_t)) addr_user_nvm_ecc_check )
 This user API function checks for single and double ECC errors on the target flash. More...
 
#define user_nvm_100tp_read   ( (int32_t(*)(uint32_t, user_100tp_read_t *)) addr_user_nvm_100tp_read )
 This user API function reads data from specified 100TP page. More...
 
#define user_nvm_100tp_write   ( (int32_t(*)(uint32_t, user_100tp_write_t *)) addr_user_nvm_100tp_write )
 This user API function writes data to a specified 100TP page. More...
 
#define user_nvm_100tp_erase   ( (int32_t(*)(uint32_t)) addr_user_nvm_100tp_erase )
 This user API function erases a data field of the specified 100TP page. The write counter field is preserved. More...
 
#define user_nvm_config_get   ( (int32_t(*)(uint32_t *, uint32_t *, uint32_t *)) addr_user_nvm_config_get )
 This user API function returns the size of each NVM segment. More...
 
#define user_nvm_page_erase   ( (int32_t(*)(uint32_t, uint32_t)) addr_user_nvm_page_erase )
 This user API function erases a specified flash page. More...
 
#define user_nvm_sector_erase   ( (int32_t(*)(uint32_t, uint32_t)) addr_user_nvm_sector_erase )
 This user API function erases a specified flash sector. More...
 
#define user_nvm_page_write   ( (int32_t(*)(uint32_t, user_nvm_page_write_t *)) addr_user_nvm_page_write )
 This user API function writes a number of bytes from the source to the specified flash address page_address. More...
 
#define user_nvm_write   user_nvm_page_write
 
#define user_nvm_mapram_init   ( (int32_t(*)(uint32_t)) addr_user_nvm_mapram_init )
 This user API function triggers the map RAM initialization on the target mapped sector. More...
 
#define user_nvm_mapram_recover   ( (int32_t(*)(uint32_t)) addr_user_nvm_mapram_recover )
 This user API function attempts to reconstruct map RAM by extracting mapping information from good pages. More...
 
#define user_nvm_service_algorithm   ( (int32_t(*)(uint32_t)) addr_user_nvm_service_algorithm )
 This user API function runs the service algorithm on a mapped sector, attempting to repair faulty pages or double mappings. More...
 
#define user_nvm_reg_write   ( (int32_t(*)(uint32_t, uint32_t )) addr_user_nvm_reg_write )
 This user API function performs a write access to NVM SFRs. More...
 
#define user_nvm_reg_read   ( (int32_t(*)(uint32_t, uint32_t *)) addr_user_nvm_reg_read )
 This user API function performs a read access to NVM SFRs. More...
 
#define user_secure_download_start   ( (int32_t(*)(uint8_t, uint8_t, uint8_t *)) addr_user_secure_download_start )
 This user API function initiates the secure container and starts the secure download process. More...
 
#define user_secure_download_update   ( (int32_t(*)(uint32_t, uint8_t *)) addr_user_secure_download_update )
 This user API function continues the secure download process. More...
 
#define user_secure_download_finish   ( (int32_t(*)(void)) addr_user_secure_download_finish )
 This user API function finalizes the secure download process. More...
 
#define user_cache_operation   ( (int32_t(*)(user_cache_op_t, uint32_t)) addr_user_cache_operation )
 This user API function provides an alternative to writing to cache registers in addition to direct register access. More...
 
#define user_ubsl_size_restore   ( (void(*)(void)) addr_user_ubsl_size_restore )
 This user API function is used to restore the UBSL size in case of a Stop mode exit w/o reset. More...
 
#define user_crypto_aes_cmac_generate_start   ( (int32_t(*)(uint32_t)) addr_user_crypto_aes_cmac_generate_start )
 This user API function initializes a CMAC generation. More...
 
#define user_crypto_aes_cmac_generate_update   ( (int32_t(*)(user_crypto_inp_buf_t *)) addr_user_crypto_aes_cmac_generate_update)
 This user API function updates the ongoing CMAC generation. More...
 
#define user_crypto_aes_cmac_generate_finish   ( (int32_t(*)(user_crypto_io_buf_t *, bool)) addr_user_crypto_aes_cmac_generate_finish)
 This user API function finalizes the ongoing CMAC generation. More...
 
#define user_crypto_aes_cmac_verify_start   ( (int32_t(*)(uint32_t)) addr_user_crypto_aes_cmac_verify_start )
 This user API function initializes a CMAC verification operation. More...
 
#define user_crypto_aes_cmac_verify_update   ( (int32_t(*)(user_crypto_inp_buf_t *)) addr_user_crypto_aes_cmac_verify_update )
 This user API function updates the ongoing CMAC verification. More...
 
#define user_crypto_aes_cmac_verify_finish   ( (int32_t(*)(user_crypto_cmac_t *)) addr_user_crypto_aes_cmac_verify_finish )
 This user API function finalizes the ongoing CMAC verification. More...
 
#define user_crypto_aes_start   ( (int32_t(*)(user_crypto_fid_t, uint32_t, user_crypto_cbc_t *)) addr_user_crypto_aes_start )
 This user API function initializes an AES operation. More...
 
#define user_crypto_aes_update   ( (int32_t(*)(user_crypto_io_buf_t *)) addr_user_crypto_aes_update )
 This user API function updates the ongoing AES operation. More...
 
#define user_crypto_aes_finish   ( (int32_t(*)(user_crypto_io_buf_t *)) addr_user_crypto_aes_finish )
 This user API function finalizes the ongoing AES operation. More...
 
#define user_crypto_key_write   ( (int32_t(*)(user_key_write_t *)) addr_user_crypto_key_write )
 This user API function writes a cryptographic key to the target key slot. More...
 
#define user_crypto_key_erase   ( (int32_t(*)(user_key_erase_t *)) addr_user_crypto_key_erase )
 This user API function erases a cryptographic key. More...
 
#define user_crypto_key_verify   ( (int32_t(*)(uint8_t, bool)) addr_user_crypto_key_verify )
 This user API function verifies an existing cryptographic key. An additional key repair operation can be enabled by setting do_repair. More...
 
#define user_nvm_ubsl_temp_protect_clear   ( (int32_t(*)(uint32_t)) addr_user_nvm_ubsl_temp_protect_clear )
 This user API function temporarily clears the write protection of the UBSL segment. More...
 
#define user_nvm_ubsl_temp_protect_set   ( (int32_t(*)(uint32_t)) addr_user_nvm_ubsl_temp_protect_set )
 This user API function temporarily sets the write protection of the UBSL segment. More...
 
#define user_secure_dualboot   ( (int32_t(*)(uint32_t)) addr_user_secure_dualboot )
 This user API function configures and enables the secondary UBSL image. More...
 

Typedefs

typedef struct user_100tp_read_t user_100tp_read_t
 
typedef struct user_100tp_write_t user_100tp_write_t
 
typedef struct user_key_t user_key_t
 Key data structure aligned with CFS page (ignored reserved bytes) More...
 
typedef enum user_crypto_fid_t user_crypto_fid_t
 
typedef struct user_crypto_inp_buf_t user_crypto_inp_buf_t
 
typedef struct user_crypto_out_buf_t user_crypto_out_buf_t
 
typedef struct user_crypto_io_buf_t user_crypto_io_buf_t
 
typedef struct user_crypto_cmac_t user_crypto_cmac_t
 
typedef struct user_crypto_cbc_t user_crypto_cbc_t
 
typedef struct user_key_write_params_t user_key_write_params_t
 
typedef struct user_key_write_t user_key_write_t
 
typedef struct user_key_erase_params_t user_key_erase_params_t
 
typedef struct user_key_erase_t user_key_erase_t
 
typedef struct user_nvm_page_write_t user_nvm_page_write_t
 
typedef enum user_cache_op_t user_cache_op_t
 
typedef enum user_nvm_segment_t user_nvm_segment_t
 

Enumerations

enum  user_crypto_fid_t { CRYPTO_ECB_ENCRYPT = 0 , CRYPTO_ECB_DECRYPT = 1 , CRYPTO_CBC_ENCRYPT = 2 , CRYPTO_CBC_DECRYPT = 3 }
 
enum  user_cache_op_t {
  CACHE_OP_AC = 0 , CACHE_OP_SC = 1 , CACHE_OP_BC = 2 , CACHE_OP_BT = 3 ,
  CACHE_OP_BL = 4 , CACHE_OP_BU = 5 , CACHE_OP_EN = 6 , CACHE_OP_DIS = 7
}
 
enum  user_nvm_segment_t { NVM_PASSWORD_SEGMENT_BOOT = 0 , NVM_PASSWORD_SEGMENT_CODE = 1 , NVM_PASSWORD_SEGMENT_DATA = 2 , NVM_PASSWORD_SEGMENT_TOTAL = 3 }
 

Macro Definition Documentation

◆ addr_user_cache_operation

#define addr_user_cache_operation   (0x159u)

◆ addr_user_cid_get

#define addr_user_cid_get   (0xc5u)

◆ addr_user_crypto_aes_cmac_generate_finish

#define addr_user_crypto_aes_cmac_generate_finish   (0x11du)

◆ addr_user_crypto_aes_cmac_generate_start

#define addr_user_crypto_aes_cmac_generate_start   (0x115u)

◆ addr_user_crypto_aes_cmac_generate_update

#define addr_user_crypto_aes_cmac_generate_update   (0x119u)

◆ addr_user_crypto_aes_cmac_verify_finish

#define addr_user_crypto_aes_cmac_verify_finish   (0x129u)

◆ addr_user_crypto_aes_cmac_verify_start

#define addr_user_crypto_aes_cmac_verify_start   (0x121u)

◆ addr_user_crypto_aes_cmac_verify_update

#define addr_user_crypto_aes_cmac_verify_update   (0x125u)

◆ addr_user_crypto_aes_finish

#define addr_user_crypto_aes_finish   (0x135u)

◆ addr_user_crypto_aes_start

#define addr_user_crypto_aes_start   (0x12du)

◆ addr_user_crypto_aes_update

#define addr_user_crypto_aes_update   (0x131u)

◆ addr_user_crypto_key_erase

#define addr_user_crypto_key_erase   (0x13du)

◆ addr_user_crypto_key_verify

#define addr_user_crypto_key_verify   (0x141u)

◆ addr_user_crypto_key_write

#define addr_user_crypto_key_write   (0x139u)

◆ addr_user_nvm_100tp_erase

#define addr_user_nvm_100tp_erase   (0xf5u)

◆ addr_user_nvm_100tp_read

#define addr_user_nvm_100tp_read   (0xedu)

◆ addr_user_nvm_100tp_write

#define addr_user_nvm_100tp_write   (0xf1u)

◆ addr_user_nvm_config_get

#define addr_user_nvm_config_get   (0xf9u)

◆ addr_user_nvm_ecc_addr_get

#define addr_user_nvm_ecc_addr_get   (0xe5u)

◆ addr_user_nvm_ecc_check

#define addr_user_nvm_ecc_check   (0xe9u)

◆ addr_user_nvm_isr_handler

#define addr_user_nvm_isr_handler   (0xc1u)

◆ addr_user_nvm_mapram_init

#define addr_user_nvm_mapram_init   (0x109u)

◆ addr_user_nvm_mapram_recover

#define addr_user_nvm_mapram_recover   (0x10du)

◆ addr_user_nvm_page_erase

#define addr_user_nvm_page_erase   (0xfdu)

◆ addr_user_nvm_page_write

#define addr_user_nvm_page_write   (0x105u)

◆ addr_user_nvm_perm_protect_set

#define addr_user_nvm_perm_protect_set   (0x161u)

◆ addr_user_nvm_reg_read

#define addr_user_nvm_reg_read   (0x149u)

◆ addr_user_nvm_reg_write

#define addr_user_nvm_reg_write   (0x145u)

◆ addr_user_nvm_sector_erase

#define addr_user_nvm_sector_erase   (0x101u)

◆ addr_user_nvm_service_algorithm

#define addr_user_nvm_service_algorithm   (0x111u)

◆ addr_user_nvm_temp_protect_get

#define addr_user_nvm_temp_protect_get   (0xe1u)

◆ addr_user_nvm_ubsl_temp_protect_clear

#define addr_user_nvm_ubsl_temp_protect_clear   (0x201u)

◆ addr_user_nvm_ubsl_temp_protect_set

#define addr_user_nvm_ubsl_temp_protect_set   (0x205u)

◆ addr_user_nvm_ucode_temp_protect_clear

#define addr_user_nvm_ucode_temp_protect_clear   (0xd5u)

◆ addr_user_nvm_ucode_temp_protect_set

#define addr_user_nvm_ucode_temp_protect_set   (0xddu)

◆ addr_user_nvm_udata_temp_protect_clear

#define addr_user_nvm_udata_temp_protect_clear   (0xd1u)

◆ addr_user_nvm_udata_temp_protect_set

#define addr_user_nvm_udata_temp_protect_set   (0xd9u)

◆ addr_user_ram_mbist

#define addr_user_ram_mbist   (0xc9u)

◆ addr_user_secure_download_finish

#define addr_user_secure_download_finish   (0x155u)

◆ addr_user_secure_download_start

#define addr_user_secure_download_start   (0x14du)

◆ addr_user_secure_download_update

#define addr_user_secure_download_update   (0x151u)

◆ addr_user_secure_dualboot

#define addr_user_secure_dualboot   (0x209u)

◆ addr_user_ubsl_size_restore

#define addr_user_ubsl_size_restore   (0x15du)

◆ IFX_KEY_ID

#define IFX_KEY_ID   (0u)

IFX key ID.

◆ user_cache_operation

#define user_cache_operation   ( (int32_t(*)(user_cache_op_t, uint32_t)) addr_user_cache_operation )

This user API function provides an alternative to writing to cache registers in addition to direct register access.

Parameters
opThe code for the cache operation to perform. For more information, refer to user_cache_op_t.
addressThe memory address, namely the FLASH1 access.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_PARAM_INVALID

◆ user_cid_get

#define user_cid_get   ( (int32_t(*)(uint32_t *)) addr_user_cid_get )

This user API function gets the customer identification number.

Parameters
customer_idPointer where to store the customer identification number (CID) read from the device configuration sector. The address indicated by the pointer must be located in RAM.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_POINTER_RAM_RANGE_INVALID

◆ USER_CMAC_SIGNATURE_SIZE

#define USER_CMAC_SIGNATURE_SIZE   (0x10u)

cmac signature size 16 bytes

◆ user_crypto_aes_cmac_generate_finish

#define user_crypto_aes_cmac_generate_finish   ( (int32_t(*)(user_crypto_io_buf_t *, bool)) addr_user_crypto_aes_cmac_generate_finish)

This user API function finalizes the ongoing CMAC generation.

It concludes the entire CMAC generation operation and clears the cryptographic context.

Parameters
bufBuffer for crypto operation. For more information, refer to user_crypto_io_buf_t.
truncation_allowedWhether the function may output a partial MAC.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_POINTER_RAM_RANGE_INVALID
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_AES_UNSUPPORTED_ERROR
ERR_LOG_CODE_AES_BUFFER_SMALL_ERROR
ERR_LOG_CODE_AES_UNAVAILABLE_ERROR
ERR_LOG_CODE_AES_ERROR

◆ user_crypto_aes_cmac_generate_start

#define user_crypto_aes_cmac_generate_start   ( (int32_t(*)(uint32_t)) addr_user_crypto_aes_cmac_generate_start )

This user API function initializes a CMAC generation.

Parameters
key_idkey ID used for CMAC generation. Key ID range is 1 to 12.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_PARAM_INVALID
ERR_LOG_CODE_KEY_SLOT_CORRUPTED
ERR_LOG_CODE_AES_UNSUPPORTED_ERROR
ERR_LOG_CODE_AES_BUFFER_SMALL_ERROR
ERR_LOG_CODE_AES_UNAVAILABLE_ERROR
ERR_LOG_CODE_AES_ERROR

◆ user_crypto_aes_cmac_generate_update

#define user_crypto_aes_cmac_generate_update   ( (int32_t(*)(user_crypto_inp_buf_t *)) addr_user_crypto_aes_cmac_generate_update)

This user API function updates the ongoing CMAC generation.

Call user_crypto_aes_cmac_generate_start routine before the first update operation. The function can be called multiple times.

Parameters
bufBuffer for crypto operation. For more information, refer to user_crypto_inp_buf_t.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_POINTER_RAM_RANGE_INVALID
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_AES_UNSUPPORTED_ERROR
ERR_LOG_CODE_AES_BUFFER_SMALL_ERROR
ERR_LOG_CODE_AES_UNAVAILABLE_ERROR
ERR_LOG_CODE_AES_ERROR

◆ user_crypto_aes_cmac_verify_finish

#define user_crypto_aes_cmac_verify_finish   ( (int32_t(*)(user_crypto_cmac_t *)) addr_user_crypto_aes_cmac_verify_finish )

This user API function finalizes the ongoing CMAC verification.

The function concludes the entire CMAC verification operation and clears the cryptographic context.

Parameters
macBuffer for crypto operation. For more information, refer to user_crypto_cmac_t.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_POINTER_RAM_RANGE_INVALID
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_AES_UNSUPPORTED_ERROR
ERR_LOG_CODE_AES_BUFFER_SMALL_ERROR
ERR_LOG_CODE_AES_UNAVAILABLE_ERROR
ERR_LOG_CODE_AES_ERROR
ERR_LOG_CODE_CMAC_VERIFY_FAIL

◆ user_crypto_aes_cmac_verify_start

#define user_crypto_aes_cmac_verify_start   ( (int32_t(*)(uint32_t)) addr_user_crypto_aes_cmac_verify_start )

This user API function initializes a CMAC verification operation.

Parameters
key_idkey ID used for CMAC verification operation. Key ID range is 1 to 12.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_PARAM_INVALID
ERR_LOG_CODE_KEY_SLOT_CORRUPTED
ERR_LOG_CODE_AES_UNSUPPORTED_ERROR
ERR_LOG_CODE_AES_BUFFER_SMALL_ERROR
ERR_LOG_CODE_AES_UNAVAILABLE_ERROR
ERR_LOG_CODE_AES_ERROR

◆ user_crypto_aes_cmac_verify_update

#define user_crypto_aes_cmac_verify_update   ( (int32_t(*)(user_crypto_inp_buf_t *)) addr_user_crypto_aes_cmac_verify_update )

This user API function updates the ongoing CMAC verification.

Call user_crypto_aes_cmac_verify_start routine before the first update operation. The function can be called multiple times.

Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Parameters
bufBuffer for crypto operation. For more information, refer to user_crypto_inp_buf_t.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_POINTER_RAM_RANGE_INVALID
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_AES_UNSUPPORTED_ERROR
ERR_LOG_CODE_AES_BUFFER_SMALL_ERROR
ERR_LOG_CODE_AES_UNAVAILABLE_ERROR
ERR_LOG_CODE_AES_ERROR

◆ user_crypto_aes_finish

#define user_crypto_aes_finish   ( (int32_t(*)(user_crypto_io_buf_t *)) addr_user_crypto_aes_finish )

This user API function finalizes the ongoing AES operation.

The function concludes the entire AES operation and clears the cryptographic context.

Parameters
bufBuffer for crypto operation. For more information, refer to user_crypto_io_buf_t.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_POINTER_RAM_RANGE_INVALID
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_PARAM_INVALID
ERR_LOG_CODE_AES_UNSUPPORTED_ERROR
ERR_LOG_CODE_AES_BUFFER_SMALL_ERROR
ERR_LOG_CODE_AES_UNAVAILABLE_ERROR
ERR_LOG_CODE_AES_ERROR

◆ user_crypto_aes_start

#define user_crypto_aes_start   ( (int32_t(*)(user_crypto_fid_t, uint32_t, user_crypto_cbc_t *)) addr_user_crypto_aes_start )

This user API function initializes an AES operation.

Parameters
fidThe ID of the desired operation. Refer to user_crypto_fid_t.
key_idThe key ID used for AES operation. Key ID range is 1 to 12.
cbc_ctxInitial vector for the CBC encryption operation. For other operations (CBC decryption or ECB operation), set this to NULL.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_POINTER_RAM_RANGE_INVALID
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_PARAM_INVALID
ERR_LOG_CODE_KEY_SLOT_CORRUPTED
ERR_LOG_CODE_AES_UNSUPPORTED_ERROR
ERR_LOG_CODE_AES_BUFFER_SMALL_ERROR
ERR_LOG_CODE_AES_UNAVAILABLE_ERROR
ERR_LOG_CODE_AES_ERROR

◆ user_crypto_aes_update

#define user_crypto_aes_update   ( (int32_t(*)(user_crypto_io_buf_t *)) addr_user_crypto_aes_update )

This user API function updates the ongoing AES operation.

Call user_crypto_aes_start routine before the first update operation. The function can be called multiple times.

Parameters
bufBuffer for crypto operation. For more information, refer to user_crypto_io_buf_t.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_POINTER_RAM_RANGE_INVALID
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_PARAM_INVALID
ERR_LOG_CODE_AES_UNSUPPORTED_ERROR
ERR_LOG_CODE_AES_BUFFER_SMALL_ERROR
ERR_LOG_CODE_AES_UNAVAILABLE_ERROR
ERR_LOG_CODE_AES_ERROR

◆ user_crypto_key_erase

#define user_crypto_key_erase   ( (int32_t(*)(user_key_erase_t *)) addr_user_crypto_key_erase )

This user API function erases a cryptographic key.

Parameters
key_erase_paramsKey erase parameters. For more information, refer to user_key_erase_t.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_POINTER_RAM_RANGE_INVALID
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_PARAM_INVALID
ERR_LOG_CODE_AES_UNSUPPORTED_ERROR
ERR_LOG_CODE_AES_BUFFER_SMALL_ERROR
ERR_LOG_CODE_AES_UNAVAILABLE_ERROR
ERR_LOG_CODE_AES_ERROR
ERR_LOG_CODE_CMAC_VERIFY_FAIL
ERR_LOG_CODE_KEY_SLOT_CORRUPTED
ERR_LOG_CODE_KEY_PROTECTED
ERR_LOG_CODE_KEY_VERSION
ERR_LOG_CODE_KEY_SIZE
ERR_LOG_CODE_KEY_ERASE_FAIL

◆ user_crypto_key_verify

#define user_crypto_key_verify   ( (int32_t(*)(uint8_t, bool)) addr_user_crypto_key_verify )

This user API function verifies an existing cryptographic key. An additional key repair operation can be enabled by setting do_repair.

Parameters
key_idID of the key to verify. Key ID range is 1 to 12.
do_repairThe repair option.
  • false: Performs a verification operation only.
  • true: Performs a verification operation. Additionally, in case of a verification failure. Attempts to repair the key slot using redundancy.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_AES_UNAVAILABLE_ERROR
ERR_LOG_CODE_PARAM_INVALID
ERR_LOG_CODE_ACCESS_AB_MODE_ERROR
ERR_LOG_CODE_KEY_SLOT_MISMATCH
ERR_LOG_CODE_KEY_SLOT_CORRUPTED
ERR_LOG_CODE_KEY_VERIFY_FAIL
ERR_LOG_CODE_NVM_VER_ERROR

◆ user_crypto_key_write

#define user_crypto_key_write   ( (int32_t(*)(user_key_write_t *)) addr_user_crypto_key_write )

This user API function writes a cryptographic key to the target key slot.

Parameters
key_write_paramsKey write parameters. For more information, refer to user_key_write_t.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_POINTER_RAM_RANGE_INVALID
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_PARAM_INVALID
ERR_LOG_CODE_AES_UNSUPPORTED_ERROR
ERR_LOG_CODE_AES_BUFFER_SMALL_ERROR
ERR_LOG_CODE_AES_UNAVAILABLE_ERROR
ERR_LOG_CODE_AES_ERROR
ERR_LOG_CODE_CMAC_VERIFY_FAIL
ERR_LOG_CODE_KEY_SLOT_CORRUPTED
ERR_LOG_CODE_KEY_PROTECTED
ERR_LOG_CODE_KEY_VERSION
ERR_LOG_CODE_KEY_SIZE
ERR_LOG_CODE_ACCESS_AB_MODE_ERROR
ERR_LOG_CODE_NVM_VER_ERROR

◆ USER_KEY_MAX_ID

#define USER_KEY_MAX_ID   (12u)

Maximum User key slot ID.

◆ USER_KEY_MIN_ID

#define USER_KEY_MIN_ID   (1u)

Minimum User key slot ID.

◆ USER_KEY_PARAM_SIZE

#define USER_KEY_PARAM_SIZE   (0x40u)

encrypted key parameter size 64 bytes

◆ USER_KEY_SIZE_128

#define USER_KEY_SIZE_128   (0x10u)

128 bits key length

◆ USER_KEY_SIZE_256

#define USER_KEY_SIZE_256   (0x20u)

256 bits key length

◆ USER_KEY_SIZE_MAX

#define USER_KEY_SIZE_MAX   (USER_KEY_SIZE_256)

Maximum length for a key value to read/store.

◆ USER_KEY_WRITE_BUFFER_SIZE

#define USER_KEY_WRITE_BUFFER_SIZE   (0x30u)

Size of key_write decryption buffer.

◆ user_nvm_100tp_erase

#define user_nvm_100tp_erase   ( (int32_t(*)(uint32_t)) addr_user_nvm_100tp_erase )

This user API function erases a data field of the specified 100TP page. The write counter field is preserved.

The function should be called if the 100TP page is corrupted. Upon successful execution, the page is initialized with an invalid checksum.

Parameters
npageThe index of the 100TP page to erase. Valid range: 0 to 7.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_100TP_PAGE_INVALID
ERR_LOG_CODE_SEGMENT_PROTECTED
ERR_LOG_CODE_ACCESS_AB_MODE_ERROR
ERR_LOG_CODE_NVM_VER_ERROR

◆ user_nvm_100tp_read

#define user_nvm_100tp_read   ( (int32_t(*)(uint32_t, user_100tp_read_t *)) addr_user_nvm_100tp_read )

This user API function reads data from specified 100TP page.

This function can read a maximum of 128 bytes (including the counter field and checksum field).

Parameters
npageThe index of the page from which to read. Valid range: 0 to 7.
params100tp read parameters. For further information, refer to user_100tp_read_t.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_POINTER_RAM_RANGE_INVALID
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_PARAM_INVALID
ERR_LOG_CODE_100TP_PAGE_INVALID
ERR_LOG_CODE_ECC2READ_ERROR

◆ user_nvm_100tp_write

#define user_nvm_100tp_write   ( (int32_t(*)(uint32_t, user_100tp_write_t *)) addr_user_nvm_100tp_write )

This user API function writes data to a specified 100TP page.

The function can write up to 124 bytes in a data field each time. The function supports maximum 100 times write operation. The function performs an implicit update of the page checksum.

Parameters
npageThe index of the page to which to write. Valid range: 0 to 7.
params100tp write parameters. For further information, refer to user_100tp_write_t.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_POINTER_RAM_RANGE_INVALID
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_PARAM_INVALID
ERR_LOG_CODE_100TP_PAGE_INVALID
ERR_LOG_CODE_SEGMENT_PROTECTED
ERR_LOG_CODE_ECC2READ_ERROR
ERR_LOG_CODE_100TP_WRITE_COUNT_EXCEEDED
ERR_LOG_CODE_ACCESS_AB_MODE_ERROR
ERR_LOG_CODE_NVM_ECC2_DATA_ERROR

◆ user_nvm_config_get

#define user_nvm_config_get   ( (int32_t(*)(uint32_t *, uint32_t *, uint32_t *)) addr_user_nvm_config_get )

This user API function returns the size of each NVM segment.

Parameters
ubsl_nvm_sizePointer to where to store the retrieved NVM UBSL segment size.
code_nvm_sizePointer to where to store the retrieved NVM UCODE segment size.
data_nvm_sizePointer to where to store the retrieved NVM UDATA segment size.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_POINTER_RAM_RANGE_INVALID

◆ user_nvm_ecc_addr_get

#define user_nvm_ecc_addr_get   ( (int32_t(*)(uint32_t, uint32_t *)) addr_user_nvm_ecc_addr_get )

This user API function returns the address of a double ECC event that has occurred in the target flash.

Parameters
[in]flashTarget flash NVM_FLASH_GROUP.
[out]pNVM_AddrPointing to ECC2 failure address.

The value of pNVM_Addr can be one of below patterns:

  • 0x11XXXXXX ECC2 failure in FLASH0 area, it indicates the absolute memory address.
  • 0x12XXXXXX ECC2 failure in FLASH1 area, it indicates the absolute memory address.
  • 0x100000XY ECC2 in 100TP pages, where X = 100TP page number, Y = block offset inside the page (block granularity: 8 bytes).
  • 0x01000000 ECC2 in internal NVM CS area, not recoverable.
Remarks
When the function exits, it clears the current ECC2 flag.
Any other NVM operations also clear the ECC2 flag.
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESSNo ECC2 event or event address has been obtained successfully.
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_USER_POINTER_RAM_RANGE_INVALID
ERR_LOG_CODE_PARAM_INVALID

◆ user_nvm_ecc_check

#define user_nvm_ecc_check   ( (int32_t(*)(uint32_t)) addr_user_nvm_ecc_check )

This user API function checks for single and double ECC errors on the target flash.

Any existing ECC errors are cleared before the check starts. Upon exit, the function clears the current ECC status.

Parameters
flashTarget flash NVM_FLASH_GROUP.
Remarks
This routine does not provide the addresses of the ECC errors. In case an ECC error is detected, call user_nvm_ecc_addr_get routine to retrieve the failure address.
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESSno single or double ECC events have occurred.
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_ECC1READ_ERROR
ERR_LOG_CODE_ECC2READ_ERROR
ERR_LOG_CODE_PARAM_INVALID

◆ user_nvm_mapram_init

#define user_nvm_mapram_init   ( (int32_t(*)(uint32_t)) addr_user_nvm_mapram_init )

This user API function triggers the map RAM initialization on the target mapped sector.

Parameters
sector_addressSector address to perform operation.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_MEM_ADDR_RANGE_INVALID
ERR_LOG_CODE_MAPRAM_INIT_PAGE_FAIL
ERR_LOG_CODE_MAPRAM_INIT_DM_PAGE_FAIL

◆ user_nvm_mapram_recover

#define user_nvm_mapram_recover   ( (int32_t(*)(uint32_t)) addr_user_nvm_mapram_recover )

This user API function attempts to reconstruct map RAM by extracting mapping information from good pages.

It can be called if the NVM Service Algorithm (SA) fails to repair a corrupted data map sector. Requests to initialize the map RAM for an unavailable sector or for a linearly mapped sector are ignored. Pages that are mapped two or more times are counted as faulty pages.

Parameters
sector_addressAddress of the sector from which to recover mapping information.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
Non-Negativesuccessful execution, indicating the amount of good mapped pages that were found.
ERR_LOG_CODE_MEM_ADDR_RANGE_INVALID
ERR_LOG_CODE_NVM_ECC2_MAPRAM_ERROR
ERR_LOG_CODE_SEMAPHORE_RESERVED

◆ user_nvm_page_erase

#define user_nvm_page_erase   ( (int32_t(*)(uint32_t, uint32_t)) addr_user_nvm_page_erase )

This user API function erases a specified flash page.

When asked to erase an unused (new) page in a mapped sector, the function does nothing and returns success. When asked to erase a page in a linear sector, the function always performs the erase.

Parameters
page_addressAddress of the NVM page to erase. Non-aligned addresses are accepted.
optionsPage erase options. Supported options:
  • #NVM_OPTIONS_NONE The default setting: background read-while-write (RWW) enabled.
  • #NVM_OPTIONS_RWW_DISABLE Disables background read-while-write.
Remarks
The status of background read-while-write (RWW) is available in the register #MEMCTRL_NVM_OP_STS.
The result of background read-while-write (RWW) is available in the register #MEMCTRL_NVM_OP_RESULT.
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
#NVM_OP_STS_FLASH_0_BUSYRWW operation on FLASH0 is triggered successfully. FLASH0 will be busy until the background RWW operation is complete.
#NVM_OP_STS_FLASH_1_BUSYRWW operation on FLASH1 is triggered successfully. FLASH1 will be busy until the background RWW operation is complete.
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_SEGMENT_PROTECTED
ERR_LOG_CODE_MEM_ADDR_RANGE_INVALID
ERR_LOG_CODE_ACCESS_AB_MODE_ERROR
ERR_LOG_CODE_NVM_ECC2_MAPRAM_ERROR

◆ user_nvm_page_write

#define user_nvm_page_write   ( (int32_t(*)(uint32_t, user_nvm_page_write_t *)) addr_user_nvm_page_write )

This user API function writes a number of bytes from the source to the specified flash address page_address.

Parameters
page_addressThe address of the NVM page to which to write the data.
paramsNVM write parameters. For further information, refer to user_nvm_page_write_t. Supported params->options:
  • #NVM_OPTIONS_NONE The default setting: corrective action disabled, RWW enabled, failpage erase enabled.
  • #NVM_OPTIONS_CORR_ACT Enables retrying the write operation if the first write operation verification failed. For EEPROM specific, it enables disturb handling, which refreshes other pages on the background for around every 1K write.
  • #NVM_OPTIONS_NO_FAILPAGE_ERASE This option applies only to mapped sectors. If it is specified, the failed written page remains. If it is not specified, the failed written page gets erased.
  • #NVM_OPTIONS_RWW_DISABLE Disables the read-while-write feature.
Remarks
The status of background read-while-write (RWW) is available in the register #MEMCTRL_NVM_OP_STS.
The result of background read-while-write (RWW) is available in the register #MEMCTRL_NVM_OP_RESULT.
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
#NVM_OP_STS_FLASH_0_BUSYRWW operation on FLASH0 is triggered successfully. FLASH0 will be busy until the background RWW operation is complete.
#NVM_OP_STS_FLASH_1_BUSYRWW operation on FLASH1 is triggered successfully. FLASH1 will be busy until the background RWW is operation complete.
ERR_LOG_CODE_PARAM_INVALID
ERR_LOG_CODE_USER_POINTER_RAM_RANGE_INVALID
ERR_LOG_CODE_ADDRESS_RANGE_CROSSING_PAGE_BOUNDARY
ERR_LOG_CODE_MEM_ADDR_RANGE_INVALID
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_ACCESS_AB_MODE_ERROR
ERR_LOG_CODE_NVM_SPARE_PAGE_NOT_AVAILABLE
ERR_LOG_CODE_NVM_ECC2_MAPBLOCK_ERROR
ERR_LOG_CODE_NVM_ECC2_DATA_ERROR
ERR_LOG_CODE_NVM_ECC2_MAPRAM_ERROR
ERR_LOG_CODE_NVM_VER_ERROR
ERR_LOG_CODE_MAPRAM_INIT_FAIL
ERR_LOG_CODE_VERIFY_AND_MAPRAM_INIT_FAIL

◆ user_nvm_perm_protect_set

#define user_nvm_perm_protect_set   ( (int32_t(*)(uint32_t)) addr_user_nvm_perm_protect_set )

This user API function sets permanent protection on NVM segments.

Parameters
passphraseAn encoding of the target segment and the erase flag. Refer to the supported passphrase.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
It is recommended to disable the interrupt before calling the function.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_USER_PROTECT_WRONG_PASSWORD
ERR_LOG_CODE_SEGMENT_PROTECTED
ERR_LOG_CODE_NVM_APPLY_PROTECTION_FAIL
ERR_LOG_CODE_ACCESS_AB_MODE_ERROR
ERR_LOG_CODE_NVM_VER_ERROR
ERR_LOG_CODE_ECC2READ_ERROR

◆ user_nvm_reg_read

#define user_nvm_reg_read   ( (int32_t(*)(uint32_t, uint32_t *)) addr_user_nvm_reg_read )

This user API function performs a read access to NVM SFRs.

Parameters
sfr_addressNVM SFR address to read from.
valuePointer to a word from which to read the SFR value.
Remarks
Register access is only allowed when the keylock passphrase is not installed.
It is an internal API for test purpose, shall not disclose it to customer.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_POINTER_RAM_RANGE_INVALID
ERR_LOG_CODE_PARAM_INVALID
ERR_LOG_CODE_SEGMENT_PROTECTED

◆ user_nvm_reg_write

#define user_nvm_reg_write   ( (int32_t(*)(uint32_t, uint32_t )) addr_user_nvm_reg_write )

This user API function performs a write access to NVM SFRs.

Parameters
sfr_addressNVM SFR address to which to write.
valueValue to write into the specified SFR.
Remarks
Register access is only allowed when the keylock passphrase is not installed.
It is an internal API for test purpose, shall not disclose it to customer.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_PARAM_INVALID
ERR_LOG_CODE_SEGMENT_PROTECTED

◆ user_nvm_sector_erase

#define user_nvm_sector_erase   ( (int32_t(*)(uint32_t, uint32_t)) addr_user_nvm_sector_erase )

This user API function erases a specified flash sector.

For a mapped sector, upon successful sector erase, the map RAM is initialized and a new spare page is selected.

Parameters
sector_addressAddress of the NVM sector to erase. Non-aligned addresses are accepted.
optionsSector erase options. Supported options:
  • #NVM_OPTIONS_NONE The default setting: RWW enabled.
  • #NVM_OPTIONS_RWW_DISABLE Disables the read-while-write feature.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
The status of background read-while-write (RWW) is available in the register #MEMCTRL_NVM_OP_STS.
The result of background read-while-write (RWW) is available in the register #MEMCTRL_NVM_OP_RESULT.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
#NVM_OP_STS_FLASH_0_BUSYRWW operation on FLASH0 is triggered successfully. FLASH0 will be busy until the background RWW operation is complete.
#NVM_OP_STS_FLASH_1_BUSYRWW operation on FLASH1 is triggered successfully. FLASH1 will be busy until the background RWW operation is complete.
ERR_LOG_CODE_MEM_ADDR_RANGE_INVALID
ERR_LOG_CODE_SEGMENT_PROTECTED
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_MAPRAM_INIT_FAIL
ERR_LOG_CODE_ACCESS_AB_MODE_ERROR

◆ user_nvm_service_algorithm

#define user_nvm_service_algorithm   ( (int32_t(*)(uint32_t)) addr_user_nvm_service_algorithm )

This user API function runs the service algorithm on a mapped sector, attempting to repair faulty pages or double mappings.

Parameters
sector_addressAddress of the sector on which to run the service algorithm (SA).
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_SEGMENT_PROTECTED
ERR_LOG_CODE_MEM_ADDR_RANGE_INVALID
ERR_LOG_CODE_SA_UNRECOVERABLE

◆ user_nvm_temp_protect_get

#define user_nvm_temp_protect_get   ( (uint32_t(*)(user_nvm_segment_t)) addr_user_nvm_temp_protect_get )

This user API function gets the current protection status of a specified NVM segment.

Parameters
segmentThe NVM segment for which to report the current protection status. For more information, refer to user_nvm_segment_t.
Returns
The current protection status of the specified NVM segment.
Return values
#NVM_RET_NOT_PROTECTEDTarget segment is not protected.
#NVM_RET_PROTECTEDTarget segment is protected.

◆ user_nvm_ubsl_temp_protect_clear

#define user_nvm_ubsl_temp_protect_clear   ( (int32_t(*)(uint32_t)) addr_user_nvm_ubsl_temp_protect_clear )

This user API function temporarily clears the write protection of the UBSL segment.

Parameters
passphraseThe passphrase must be #NVM_SEG_PROT_UBSL_NO_ERASE.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_PROTECT_WRONG_PASSWORD
ERR_LOG_CODE_SEMAPHORE_RESERVED

◆ user_nvm_ubsl_temp_protect_set

#define user_nvm_ubsl_temp_protect_set   ( (int32_t(*)(uint32_t)) addr_user_nvm_ubsl_temp_protect_set )

This user API function temporarily sets the write protection of the UBSL segment.

Parameters
passphraseThe passphrase must be #NVM_SEG_PROT_UBSL_NO_ERASE.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_PROTECT_WRONG_PASSWORD
ERR_LOG_CODE_SEMAPHORE_RESERVED

◆ user_nvm_ucode_temp_protect_clear

#define user_nvm_ucode_temp_protect_clear   ( (int32_t(*)(uint32_t)) addr_user_nvm_ucode_temp_protect_clear )

This user API function temporarily clears the write protection of the UCODE segment.

Parameters
passphraseThe passphrase must be #NVM_SEG_PROT_CODE_NO_ERASE.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_PROTECT_WRONG_PASSWORD
ERR_LOG_CODE_SEMAPHORE_RESERVED

◆ user_nvm_ucode_temp_protect_set

#define user_nvm_ucode_temp_protect_set   ( (int32_t(*)(uint32_t)) addr_user_nvm_ucode_temp_protect_set )

This user API function temporarily sets the write protection of the UCODE segment.

Parameters
passphraseThe passphrase must be #NVM_SEG_PROT_CODE_NO_ERASE.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_PROTECT_WRONG_PASSWORD
ERR_LOG_CODE_SEMAPHORE_RESERVED

◆ user_nvm_udata_temp_protect_clear

#define user_nvm_udata_temp_protect_clear   ( (int32_t(*)(uint32_t)) addr_user_nvm_udata_temp_protect_clear )

This user API function temporarily clears the write protection of the UDATA segment.

Parameters
passphraseThe passphrase must be #NVM_SEG_PROT_DATA_NO_ERASE.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_PROTECT_WRONG_PASSWORD
ERR_LOG_CODE_SEMAPHORE_RESERVED

◆ user_nvm_udata_temp_protect_set

#define user_nvm_udata_temp_protect_set   ( (int32_t(*)(uint32_t)) addr_user_nvm_udata_temp_protect_set )

This user API function temporarily sets the write protection of the UDATA segment.

Parameters
passphraseThe passphrase must be #NVM_SEG_PROT_DATA_NO_ERASE.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_USER_PROTECT_WRONG_PASSWORD
ERR_LOG_CODE_SEMAPHORE_RESERVED

◆ user_nvm_write

#define user_nvm_write   user_nvm_page_write

◆ user_ram_mbist

#define user_ram_mbist   ( (int32_t(*)(uint32_t, uint32_t)) addr_user_ram_mbist )

This user API function performs a MBIST on the specified SRAM range. Start address shall be smaller than end address.

Parameters
start_addressRAM memory address at which to start the MBIST test. Range is 0x18000000 + device RAM size.
end_addressRAM memory address up to which to perform the MBIST test. Range is 0x18000000 + device RAM size.
Remarks
The execution of MBIST changes the RAM content in the specified range. Make sure that the user stack does not get destroyed.
This function is not interruptible. Interrupts must be disabled before the call and only re-enabled after it has finished.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_MBIST_RAM_RANGE_INVALID
ERR_LOG_CODE_MBIST_FAILED

◆ user_secure_download_finish

#define user_secure_download_finish   ( (int32_t(*)(void)) addr_user_secure_download_finish )

This user API function finalizes the secure download process.

The function concludes the entire secure download process and clears the cryptographic context.

Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_AES_UNSUPPORTED_ERROR
ERR_LOG_CODE_AES_BUFFER_SMALL_ERROR
ERR_LOG_CODE_AES_UNAVAILABLE_ERROR
ERR_LOG_CODE_AES_ERROR

◆ user_secure_download_start

#define user_secure_download_start   ( (int32_t(*)(uint8_t, uint8_t, uint8_t *)) addr_user_secure_download_start )

This user API function initiates the secure container and starts the secure download process.

The function tries to decrypt the first [0th:31th] bytes of the input streaming data. Upon successful start of secure download operation, the next call of user_secure_download_update routine expects [32th:159th] byte of input streaming data.

Parameters
key_idThe ID of the key for decryption, key ID range is 0 to 12.
n_sectorsSize in sectors, of the new secure container.
dataAddress of the input buffer.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_USER_POINTER_RAM_RANGE_INVALID
ERR_LOG_CODE_SIZE_INVALID
ERR_LOG_CODE_SEGMENT_PROTECTED
ERR_LOG_CODE_ACCESS_AB_MODE_ERROR
ERR_LOG_CODE_PARAM_INVALID
ERR_LOG_CODE_AES_UNSUPPORTED_ERROR
ERR_LOG_CODE_AES_BUFFER_SMALL_ERROR
ERR_LOG_CODE_AES_UNAVAILABLE_ERROR
ERR_LOG_CODE_AES_ERROR

◆ user_secure_download_update

#define user_secure_download_update   ( (int32_t(*)(uint32_t, uint8_t *)) addr_user_secure_download_update )

This user API function continues the secure download process.

Call the user_secure_download_start routine before the first update operation. The function can be called multiple times. Each call decrypts 128 bytes of input streaming data and writes the decrypted data (128 bytes) into the target page. The user shall feed in new data with each call.

Parameters
page_indexThe index of the page to which to write, starting from a secure container start address.
dataAddress of the input buffer.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_USER_POINTER_RAM_RANGE_INVALID
ERR_LOG_CODE_PARAM_INVALID
ERR_LOG_CODE_AES_UNSUPPORTED_ERROR
ERR_LOG_CODE_AES_BUFFER_SMALL_ERROR
ERR_LOG_CODE_AES_UNAVAILABLE_ERROR
ERR_LOG_CODE_AES_ERROR
ERR_LOG_CODE_NVM_VER_ERROR

◆ user_secure_dualboot

#define user_secure_dualboot   ( (int32_t(*)(uint32_t)) addr_user_secure_dualboot )

This user API function configures and enables the secondary UBSL image.

Parameters
image_offsetNew image address offset (the offset of startup page address), starting from the UBSL segment start address.
Remarks
In an interrupt or multithreaded environment, this function cannot be called in a re-entrant context.
Returns
Function execution status.
Return values
ERR_LOG_SUCCESS
ERR_LOG_CODE_MEM_ADDR_RANGE_INVALID
ERR_LOG_CODE_SEMAPHORE_RESERVED
ERR_LOG_CODE_ACCESS_AB_MODE_ERROR
ERR_LOG_CODE_NVM_VER_ERROR

◆ user_ubsl_size_restore

#define user_ubsl_size_restore   ( (void(*)(void)) addr_user_ubsl_size_restore )

This user API function is used to restore the UBSL size in case of a Stop mode exit w/o reset.

Remarks
If user has an UBSL size configuration different than the default setting, in case of stop mode exit w/o reset, this function must be called after exit from the Stop mode.

Typedef Documentation

◆ user_100tp_read_t

◆ user_100tp_write_t

◆ user_cache_op_t

◆ user_crypto_cbc_t

◆ user_crypto_cmac_t

◆ user_crypto_fid_t

◆ user_crypto_inp_buf_t

◆ user_crypto_io_buf_t

◆ user_crypto_out_buf_t

◆ user_key_erase_params_t

◆ user_key_erase_t

◆ user_key_t

typedef struct user_key_t user_key_t

Key data structure aligned with CFS page (ignored reserved bytes)

◆ user_key_write_params_t

◆ user_key_write_t

◆ user_nvm_page_write_t

◆ user_nvm_segment_t

NVM protection API password segment

Enumeration Type Documentation

◆ user_cache_op_t

Enumerator
CACHE_OP_AC 

Cache all clean operation.

CACHE_OP_SC 

Cache set clean operation.

CACHE_OP_BC 

Cache block clean operation.

CACHE_OP_BT 

Cache block touch operation.

CACHE_OP_BL 

Cache block lock operation.

CACHE_OP_BU 

Cache block unlock operation.

CACHE_OP_EN 

Cache enable operation.

CACHE_OP_DIS 

Cache disable operation.

◆ user_crypto_fid_t

Enumerator
CRYPTO_ECB_ENCRYPT 
CRYPTO_ECB_DECRYPT 
CRYPTO_CBC_ENCRYPT 
CRYPTO_CBC_DECRYPT 

◆ user_nvm_segment_t

NVM protection API password segment

Enumerator
NVM_PASSWORD_SEGMENT_BOOT 

NVM password for customer segment, used for customer bootloader (NVM FLASH0).

NVM_PASSWORD_SEGMENT_CODE 

NVM password for customer code segment, which is not used by the customer bootloader (NVM FLASH1).

NVM_PASSWORD_SEGMENT_DATA 

NVM password for customer data mapped segment (NVM FLASH0).

NVM_PASSWORD_SEGMENT_TOTAL 

Can be ignored and should not be used.