DocID025202 Rev 7
68/1080
RM0365
Embedded Flash memory
80
Level 1: Read protection
This is the default protection level when RDP option byte is erased. It is defined as well
when RDP value is at any value different from 0xAA and 0xCC, or even if the complement is
not correct.
•
User mode:
Code executing in user mode can access main memory Flash and option
bytes with all operations.
•
Debug, boot RAM and boot loader modes:
In debug mode or when code is running
from boot RAM or boot loader, the main Flash memory and the backup registers
(RTC_BKPxR in the RTC) are totally inaccessible. In these modes, even a simple read
access generates a bus error and a Hard Fault interrupt. The main memory is
program/erase protected to prevent malicious or unauthorized users from
reprogramming any of the user code with a dump routine. Any attempted
program/erase operation sets the PGERR flag of Flash status register (FLASH_SR).
When the RDP is reprogrammed to the value 0xAA to move back to Level 0, a mass
erase of main memory Flash is performed and the backup registers (RTC_BKPxR in
the RTC) are reset.
Level 2: No debug
In this level, the protection level 1 is guaranteed. In addition, the Cortex
®
-M4 debug
capabilities are disabled. Consequently, the debug port, the boot from RAM (boot RAM
mode) and the boot from System memory (boot loader mode) are no more available. In user
execution mode, all operations are allowed on the Main Flash memory. On the contrary, only
read and program operations can be performed on the option bytes.
Option bytes cannot be erased. Moreover, the RDP bytes cannot be programmed. Thus, the
level 2 cannot be removed at all: it is an irreversible operation. When attempting to program
the RDP byte, the protection error flag WRPRTERR is set in the Flash_SR register and an
interrupt can be generated.
Note:
The debug feature is also disabled under reset.
STMicroelectronics is not able to perform analysis on defective parts on which the level 2
protection has been set.