PM0075
The write protection is activated by configuring the WRP[3:0] option bytes, and then by
applying a system reset to reload the new WRPx option bytes.
Unprotection
To disable the write protection, two application cases are provided:
●
Case 1: Read protection disabled after the write unprotection:
–
–
–
●
Case 2: Read protection maintained active after the write unprotection, useful for in-
application programming with a user boot loader:
–
–
2.4.3
Option byte block write protection
The option bytes are always read-accessible and write-protected by default. To gain write
access (Program/Erase) to the option bytes, a sequence of keys (same as for lock) has to
be written into the OPTKEYR. A correct sequence of keys gives write access to the option
bytes and this is indicated by OPTWRE in the FLASH_CR register being set. Write access
can be disabled by resetting the bit through software.
2.5
Option byte description
There are eight option bytes. They are configured by the end user depending on the
application requirements. As a configuration example, the watchdog may be selected in
hardware or software mode.
A 32-bit word is split up as follows in the option bytes.
Table 6.
complemented option
The organization of these bytes inside the information block is as shown in
The option bytes can be read from the memory locations listed in
byte register (FLASH_OBR).
Note:
The new programmed option bytes (user, read/write protection) are loaded after a system
reset.
Erase the entire option byte area by using the OPTER bit in the Flash memory
control register (FLASH_CR)
Program the correct RDP code 0x00A5 to unprotect the memory. This operation
first forces a Mass Erase of the main Flash memory.
Reset the device (system reset) to reload the option bytes (and the new WRP[3:0]
bytes), and to disable the write protection
Erase the entire option byte area by using the OPTER bit in the Flash memory
control register (FLASH_CR)
Reset the device (system reset) to reload the option bytes (and the new WRP[3:0]
bytes), and to disable the write protection.
Option byte format
31-24
Option byte 1
byte1
Reading/programming the embedded Flash memory
23-16
complemented option
Doc ID 17863 Rev 1
15 -8
Option byte 0
byte0
Table
Table 7
or from the Option
7-0
7.
19/31
Need help?
Do you have a question about the STM32F101xx series and is the answer not in the manual?