Firmware User Manual (AE-step)
88
Revision 1.02
2019-04-24
TLE984x Firmware User Manual
Parameters
Return Values
Remarks
It is not allowed to be called by NVM callback routines or any interrupt or multi-threaded environment in a re-
entrant context.
6.8.15
user_nvm_password_set
Description
This user API function sets a read and/or write protection for any NVM region individually. The API does not
change the protection state for a region where password protection is currently installed.
The password parameter consists of a 30-bit password (bit 0...29) and two additional protection bits (bit 30 +
bit 31).
A valid password must be different from 0x3FFFFFFF and 0x00000000 (bit 0...29). The two MS bits in the
password contain the protection type, where setting bit 31 activates the read protection and setting bit 30
activates the write protection. A non-compliant password is rejected. The function rejects with an error in case
the NVM code segment is write protected.
A password can only be applied in case no valid password is currently set for the requested region.
Prototype
int32_t user_nvm_password_set (
Data Type
Name
Description
Dir
uint32_t
password
Current active password for the segment . A valid
password parameter consists of a 30-bit password (bits
0...29), bits 30 and 31 are ignored.
-
segment
Segment where password should be cleared
-
Data Type
Description
int32_t
ERR_LOG_SUCCESS in case the password could be successfully applied, otherwise
a negative error code. Returned error code can be one of the following:
ERR_LOG_SUCCESS, ERR_LOG_CODE_USER_PROTECT_NO_CBSL_PWD_CLEAR,
ERR_LOG_CODE_USER_NVM_PROTECT_SEGMENT_INVALID,
ERR_LOG_CODE_NVM_SEMAPHORE_RESERVED,
ERR_LOG_CODE_CS_PAGE_CHECKSUM, ERR_LOG_CODE_CS_PAGE_ECC2READ,
ERR_LOG_CODE_USER_PROTECT_NO_PASSWORD_EXISTS,
ERR_LOG_CODE_ACCESS_AB_MODE_ERROR,
ERR_LOG_CODE_NVM_PROTECT_REMOVE_PASSWORD_FAILED,
ERR_LOG_CODE_USER_PROTECT_NVM_AND_PWD_ERASED,
ERR_LOG_CODE_NVM_VER_ERROR