Embedded Flash memory (FLASH)
3.5
FLASH memory protection
The Flash main memory can be protected against external accesses with the Read
protection (RDP). The pages of the Flash memory can also be protected against unwanted
write due to loss of program counter contexts. The write-protection (WRP) granularity is one
page (2 KBytes). Apart of the flash memory can also be protected against read and write
from third parties (PCROP). The PCROP granularity is double word (64-bit).
3.5.1
Read protection (RDP)
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. The read protection protects to the Flash
main memory, the option bytes, the backup registers (RTC_BKPxR in the RTC) and the
SRAM2.
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
RDP byte value
0xAA
Any value except 0xAA or
0xCC
0xCC
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 Flash main memory area are possible. The
option bytes, the SRAM2 and the backup registers are also accessible by all operations.
100/1693
Table
11.
Table 11. Flash memory read protection status
RDP complement value
0x55
Any value (not necessarily
complementary) except 0x55 and
0x33
0x33
DocID024597 Rev 3
RM0351
Read protection level
Level 0
Level 1 (default)
Level 2
Need help?
Do you have a question about the STM32L4x6 and is the answer not in the manual?
Questions and answers