RM0367 Rev 7 111/1043
RM0367 Flash program memory and data EEPROM (FLASH)
122
Bit 2 OPTLOCK: Option bytes lock
This bit blocks the write/erase operations to the user Option bytes area and the
OBL_LAUNCH bit (in this register). It can only be written to 1 to re-lock. To reset to 0, a correct
sequence of unlock with OPTKEYR register is necessary (see Unlocking the Option bytes
area), with PELOCK bit at 0. If the sequence is not correct, the bit will be locked until the next
system reset and a hard fault is generated. If the sequence is executed when PELOCK = 1,
the bit remains locked and no hard fault is generated. The keys to unlock are:
– First key:0xFBEAD9C8
– Second key: 0x24252627
0: The write and erase operations in the Option bytes area are disabled.
1: The write and erase operations in the Option bytes area are enabled.
Note: This bit is set when PELOCK is set.
Bit 1 PRGLOCK: Program memory lock
This bit blocks the write/erase operations to the Flash program memory. It can only be written
to 1 to re-lock. To reset to 0, a correct sequence of unlock with PRGKEYR register is
necessary (see Unlocking the Flash program memory), with PELOCK bit at 0. If the sequence
is not correct, the bit will be locked until the next system reset and a hard fault is generated. If
the sequence is executed when PELOCK = 1, the bit remains locked and no hard fault is
generated. The keys to unlock are:
– First key:0x8C9DAEBF
– Second key: 0x13141516
0: The write and erase operations in the Flash program memory are disabled.
1: The write and erase operations in the Flash program memory are enabled.
Note: This bit is set when PELOCK is set.
Bit 0 PELOCK: FLASH_PECR lock
This bit locks the FLASH_PECR register. It can only be written to 1 to re-lock. To reset to 0, a
correct sequence of unlock with PEKEYR register (see Unlocking the data EEPROM and the
FLASH_PECR register) is necessary. If the sequence is not correct, the bit will be locked until
the next system reset and one hard fault is generated. The keys to unlock are:
– First key: 0x89ABCDEF
– Second key: 0x02030405
0: The FLASH_PECR register is unlocked; it can be modified and the other bits unlocked.
Data write/erase operations are enabled.
1: The FLASH_PECR register is locked and no write/erase operation can start.