26.5.5 Region Lock Bits

The NVM main array is divided into 16 equally sized regions. The region size is dependent on the Flash memory size, and is given in the table below. Each region has a dedicated Lock bit preventing writing and erasing pages in the region. After production, all regions will be unlocked.

Table 26-1. Region Size
Memory Size [KB] Region Size [KB]
512 32
256 16
128 8

To temporarily lock or unlock a region, the Lock Region and Unlock Region commands are provided. Writing one of these commands will temporarily lock or unlock the region containing the address loaded in the ADDR register. ADDR can be written by software, or the automatically loaded value from a write operation can be used. The new setting will stay in effect until the next Reset, or until the setting is changed again using the Lock and Unlock commands. The current status of the lock can be determined by reading the LOCK register.

To change the default lock or unlock setting for a region, the user row from the Configuration Rows must be written using the Write Auxiliary Page command. Writing to the Configuration Rows will take effect after the next Reset. Therefore, a boot of the device is needed for changes in the lock or unlock setting to take effect. Refer to the Physical Memory Map for the Configuration Rows address mapping.

Note:
  1. The Data Flash is outside of the regions Lock bits range, and consequently cannot be write protected.
  2. The boot loader section is write protected by the BOOTPROT fuse and by the Lock bits corresponding to its address space.