28.2.79 __builtin_write_NVM_secure
Description
Enables the Flash for writing by issuing an unlock sequence specified by two keys and enabling the Write bit of the NVMCON register. After completion, the two keys are cleared to zero.
Interrupts may need to be disabled for proper operation.
This builtin
function can be used as a part of a complex sequence
discussed in your device data sheet or Family Reference Manual (FRM). See these
documents for more information.
Prototype
void __builtin_write_NVM_secure(uint16_t key1, uint16_t key2);
Arguments
key1
– first key in the NVM unlock sequence
key2
– second key in the NVM unlock sequence
Return Value
None
Example Instruction sequence
mov w0, _NVMKEY
nop
mov w1, _NVMKEY
bset _NVMCON,#15
clr w0
clr w1
Error Messages
None