8.11 LOCK - Memory Sections Access Protection
The device can be locked, 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 device is locked by writing a non-valid key to the Lock Key (LOCK.KEY) register.
Memory Section | CPU Access | UPDI Access | ||
---|---|---|---|---|
Read | Write | Read | Write | |
Flash | Yes | Yes | Yes | Yes |
SRAM | Yes | Yes | Yes | Yes |
EEPROM | Yes | Yes | Yes | Yes |
SIGROW | Yes | No | Yes | No |
BOOTROW | Yes(2) | Yes(2) | Yes | Yes |
USERROW | Yes | Yes | Yes | Yes |
FUSE | Yes | No | Yes | Yes |
LOCK | Yes | No | Yes | Yes |
Registers | Yes | Yes | Yes | Yes |
Memory Section | CPU Access | UPDI Access | ||
---|---|---|---|---|
Read | Write | Read | Write | |
Flash | Yes | Yes | No | No |
SRAM | Yes | Yes | No | No |
EEPROM | Yes | Yes | No | No |
SIGROW | Yes | No | No | No |
BOOTROW | Yes(2) | Yes(2) | No | No |
USERROW | Yes | Yes | No | Yes(3) |
FUSE | Yes | No | No | No |
LOCK | Yes | No | No | No |
Registers | Yes | Yes | No | No |
Note:
- Read operations marked No in the tables may appear successful, but the data are invalid. Hence, any attempt of code validation through the UPDI will fail on these memory sections.
- Write and read only possible from the Boot section
- In the 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.