RM0402
Flash memory are possible in all boot configurations (Flash user boot, debug or boot
from RAM).
•
Level 1: read protection enabled
It is the default read protection level after option byte erase. The read protection Level
1 is activated by writing any value (except for 0xAA and 0xCC used to set Level 0 and
Level 2, respectively) into the RDP option byte. When the read protection Level 1 is set:
–
–
When Level 1 is active, programming the protection option byte (RDP) to Level 0
causes the Flash memory to be mass-erased. As a result the user code area is cleared
before the read protection is removed. The mass erase only erases the user code area.
The other option bytes including write protections remain unchanged from before the
mass-erase operation. The OTP area is not affected by mass erase and remains
unchanged. Mass erase is performed only when Level 1 is active and Level 0
requested. When the protection level is increased (0->1, 1->2, 0->2) there is no mass
erase.
•
Level 2: debug/chip read protection disabled
The read protection Level 2 is activated by writing 0xCC to the RDP option byte. When
the read protection Level 2 is set:
–
–
–
–
–
Memory read protection Level 2 is an irreversible operation. When Level 2 is activated,
the level of protection cannot be decreased to Level 0 or Level 1.
Note:
The JTAG port is permanently disabled when Level 2 is active (acting as a JTAG fuse). As a
consequence, boundary scan cannot be performed. STMicroelectronics is not able to
perform analysis on defective parts on which the Level 2 protection has been set.
No access (read, erase, program) to Flash memory can be performed while the
debug feature is connected or while booting from RAM or system memory
bootloader. A bus error is generated in case of read request.
When booting from Flash memory, accesses (read, erase, program) to Flash
memory from user code are allowed.
All protections provided by Level 1 are active.
Booting from RAM or system memory bootloader is no more allowed.
JTAG, SWV (single-wire viewer), ETM, and boundary scan are disabled.
User option bytes can no longer be changed.
When booting from Flash memory, accesses (read, erase and program) to Flash
memory from user code are allowed.
Embedded Flash memory interface
RM0402 Rev 6
69/1163
81
Need help?
Do you have a question about the STM32F412 and is the answer not in the manual?
Questions and answers