7.10 LOCK - Memory Sections Access Protection

The device can be locked so that the memories cannot be read using the Unified Program and Debug Interface (UPDI). The locking protects the Flash (all Boot Code, Application Code, and Application Data sections), SRAM, and the EEPROM, including the FUSE data, preventing the reading of application data or code using the debugger interface. Regular memory access from within the application is still enabled.

The CPU and UPDI can read the Lock Key, but it can only be programmed or cleared by the UPDI. The device is locked by writing a non-valid key to the Lock Key (LOCK.KEY) register.

Table 7-5. Memory Access Unlocked (LOCK.KEY Valid Key)(1)
Memory SectionCPU AccessUPDI Access
ReadWriteReadWrite
Flash YesYesYesYes
SRAMYesYesYesYes
EEPROMYesYesYesYes
SIGROWYesNoYesNo
USERROWYesYesYesYes
FUSEYesNoYesYes
LOCKYesNoYesYes
RegistersYesYesYesYes
Table 7-6. Memory Access Locked (LOCK.KEY Invalid Key)(1)
Memory SectionCPU AccessUPDI Access
ReadWriteReadWrite
Flash YesYesNoNo
SRAMYesYesNoNo
EEPROMYesYesNoNo
SIGROWYesNoNoNo
USERROWYesYesNoYes(2)
FUSEYesNoNoNo
LOCKYesNoNoNo
RegistersYesYesNoNo
Note:
  1. Read operations marked No in the tables may appear successful, but the data is invalid. Hence, any code validation attempt through the UPDI will fail on these memory sections.
  2. In the Locked mode, the USERROW can be written using the Fuse Write command, but the current USERROW values cannot be read out.
Important: The only way to unlock a device is a CHIPERASE. No application data is retained.