Embedded Flash memory
RM0365
67/1080
DocID025202 Rev 7
4.3 Memory
protection
The user area of the Flash memory can be protected against read by untrusted code. The
pages of the Flash memory can also be protected against unwanted write due to loss of
program counter contexts. The write-protection granularity is two pages.
4.3.1 Read
protection
The read protection is activated by setting the RDP option byte and then, by applying a
system reset to reload the new RDP option byte.
Note:
If the read protection is set while the debugger is still connected through JTAG/SWD, apply
a POR (power-on reset) instead of a system reset.
There are three levels of read protection from no protection (level 0) to maximum protection
or no debug (level 2).
The Flash memory is protected when the RDP option byte and its complement contain the
pair of values shown in
.
The System memory area is read accessible whatever the protection level. It is never
accessible for program/erase operation
Level 0: no protection
Read, program and erase operations into the main memory Flash area are possible. The
option bytes are also accessible by all operations.
Table 7. Flash memory read protection status
RDP byte value
RDP complement value
Read protection level
0xAA
0x55
Level 0 (ST production
configuration)
Any value except 0xAA or
0xCC
Any value (not necessarily
complementary) except 0x55 and
0x33
Level 1
0xCC
0x33
Level 2