8.11 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). Locking protects Flash (all Boot Code, Application Code, and Application Data sections), SRAM, and the EEPROM, including the FUSE data, thereby preventing application data or code from being read through the debugger interface. Regular memory access from within the application remains enabled.

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

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