Firmware User Manual (AE-step)
90
Revision 1.02
2019-04-24
TLE984x Firmware User Manual
Return Values
6.8.17
user_nvm_protect_set
Description
This user API function sets a read and/or write protection for any NVM region individually. The API changes the
protection state for a region, but does not update the installed password in configuration sector.
A valid password must be provided in case any valid NVM protection password is installed for this region.
All NVM segment data (BSL-, Code- and Data- regions) and all passwords are erased in case a wrong password
is provided. Before erasing starts, all interrupts including NMI are temporarily disabled and any NVM and NVM
CS protection is disabled. Once erase is completed, protection and interrupts are restored to their original
state.
Set bit 31 of the password parameter to enable read protection, set bit 30 of the password parameter to enable
write protection. The bits (0...29) of the password parameter shall match the password installed before. In
case no valid protection password is currently installed, bits (0...29) are ignored.
Prototype
int32_t user_nvm_protect_set (
uint32_t password
NVM_PASSWORD_SEGMENT_t segment
)
Parameters
Data Type
Description
uint32_t
Current protection status of the NVM segment selected:
Protection disabled: 0x00000000
read protection enabled: 0x80000000
Write protection enabled: 0x40000000
Read and write protection enabled: 0xC0000000
Segment not recognized: 0xFFFFFFFF
Data Type
Name
Description
Dir
uint32_t
password
Protection password to apply on the given segment
-
segment
Segment which should be password protected
-