RM0401 Rev 3 57/771
RM0401 Embedded Flash memory interface
68
--
Figure 5 shows how to go from one RDP level to another.
Figure 5. RDP levels
3.6.4 Write protections
Up to 5 user sectors in Flash memory can be protected against unwanted write operations
due to loss of program counter contexts. When the non-write protection nWRPi bit (0
≤ i ≤ 4)
in the FLASH_OPTCR registers is low, the corresponding sector cannot be erased or
programmed. Consequently, a mass erase cannot be performed if one of the sectors is
write-protected.
Table 11. Access versus read protection level
Memory area
Protection
Level
Debug features, Boot from RAM or
from System memory bootloader
Booting from Flash memory
Read Write Erase Read Write Erase
Main Flash Memory
Level 1 NO NO
(1)
YES
Level 2 NO YES
Option Bytes
Level 1 YES YES
Level 2 NO NO
OTP
Level 1 NO NA YES NA
Level 2 NO NA YES NA
1. The main Flash memory is only erased when the RDP changes from level 1 to 0. The OTP area remains unchanged.
,EVEL
LEVE,LEVE,
H!!0$2H##0$2
2$0!!H
2$0##H
DEFAULT
/PTIONSWRITE2$0LEVELINCREASEINCLUDES
/PTIONSERASE
.EWOPTIONSPROGRAM
/PTIONSWRITE2$0LEVELDECREASEINCLUDES
-ASSERASE
/PTIONSERASE
.EWOPTIONSPROGRAM
/PTIONSWRITE2$0LEVELIDENTICALINCLUDES
/PTIONSERASE
.EWOPTIONSPROGRAM
2$0!!H
/THERSOPTIONSMODIFIED
2$0!!H##H
/THERSOPTIONSMODIFIED
7RITEOPTIONS
INCLUDING
2$0!!H
7RITEOPTIONS
INCLUDING
2$0##H
7RITEOPTIONS
INCLUDING
2$0##H
7RITEOPTIONSINCLUDING
2$0##H!!H
AI