4.2 Storage Area Flash Lock (SAFLOCK)

The SAFLOCK Configuration bit protects the SAF memory block against unauthorized write operations and renders it OTP.

Once the SAFLOCK feature is activated, i.e., the SAFLOCK Configuration bit has been programmed to 0:

  1. The SAF Block becomes write-protected, and the data stored in the SAF Block cannot be overwritten or erased using a programming and debugging tool through the ICSP interface or self-write.
  2. The content of the SAF area remains accessible through the ICSP read command interface or NVM Read functions.
  3. The SAFSZ Configuration bits cannot be erased. As a result, it is not possible to revert the configuration of the SAF area or reduce its size. However, the size of the SAF area can be increased by setting the corresponding SAFSZ bits to 0.
CAUTION: Once the SAFLOCK bit is enabled, it cannot be disabled, even through a Bulk Erase operation.

The SAFLOCK feature allows the user to permanently lock the configured SAF area. This makes the configured SAF area OTP and protects the contents of the SAF area from internal and external unintended tampering.

Any attempts to perform write operations to the microcontroller's SAF region through the ICSP interface will result in a programmer communication error message. This message will appear in the Debugger output window of MPLAB X IDE, as shown in the SAF Area Protection Warning figure.

Figure 4-5. SAF Area Protection Warning