7.11 LOCK - Memory Sections Access Protection

The device can be locked, making the memories unreadable using the 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.

Writing a nonvalid key to the Lock Key (LOCK.KEY) register locks the device.

Table 7-5. Memory Access Unlocked (FUSE.LOCK Valid Key)(1)
Memory SectionCPU AccessUPDI Access
ReadWriteReadWrite
Flash YesYesYesYes
SRAMYesYesYesYes
EEPROMYesYesYesYes
SIGROWYesNoYesNo
USERROWYesYesYesYes
BOOTROW(3)YesYesYesYes
FUSESYesNoYesYes
I/O MemoryYesYesYesYes
Table 7-6. Memory Access Locked (FUSE.LOCK Invalid Key)(1)
Memory SectionCPU AccessUPDI Access
ReadWriteReadWrite
Flash YesYesNoNo
SRAMYesYesNoNo
EEPROMYesYesNoNo
SIGROWYesNoNoNo
USERROWYesYesNoYes(2)
BOOTROW(3)YesYesNoNo
FUSESYesNoNoNo
I/O MemoryYesYesNoNo
Note:
  1. Read operations marked No in the tables may appear successful, but the data is invalid. Hence, any attempt of code validation through the UPDI will fail on these memory sections.
  2. Using the Fuse Write command in the Locked mode can write the USERROW, but it is impossible to read out the current USERROW values.
  3. The BOOTROW can be read and written only from the BOOT section.
Important: The only way to unlock a device is a CHIPERASE, which won't erase the USERROW and not retain any application data.