Flash program memory and data EEPROM (FLASH) RM0367
98/1043 RM0367 Rev 7
Figure 6. RDP levels
3.4.2 PcROP (Proprietary Code Read-Out Protection)
The Flash program memory can be protected from being read by a hacking code: the read
data are blocked (not for a fetch). The protected code must not access data in the protected
zone, including the literal pool.
The Flash program memory can be protected against a hacking code read: this blocks the
data read (not for a fetch), assuming that the native code is compiled according to the
PcROP option. This mode is activated setting WPRMOD = 1 in the FLASH_OPTR register.
The protection granularity is the sector (1 sector = 32 pages = 4 KB). To protect a sector, set
to 0 the right bit in the WRPROT configuration: 0 means read and write protection, 1 means
no protection.
Table 20 shows the link between the bits of the WRPROT configuration and the address of
the Flash memory sectors.
MS34776V1
RDP increase
RDP decrease
RDP unchanged
RDP = 0xAA
Mass erase
Write
RDP /= 0xCC and
Write
RDP /= 0xAA
Level 0
RDP = 0xAA
Write
RDP = 0xAA
Level 1
RDP /= 0xAA
RDP /= 0xCC
(default)
RDP /= 0xAA and
RDP /= 0xCC
Write
Write
RDP = 0xCC
Level 2
RDP = 0xCC
Write
RDP = 0xCC
Table 19. Protection level and content of RDP Option bytes
RDP byte value RDP complementary value Read Protection status
0xAA 0x55 Level 0
0xCC 0x33 Level 2
Any other value Complement of RDP byte Level 1
Any value Not the complement value of RDP byte Level 1