English
Language : 

RM0367 Datasheet, PDF (95/1009 Pages) STMicroelectronics – This reference manual targets application developers
Flash program memory and data EEPROM (FLASH)
RM0367
EEPROM and Option bytes areas without restrictions. It is also possible to read and
write the backup registers freely.
• Level 1: memory read protection
Level 1 is set when RDPROT is set to any value except 0xAA and 0xCC, respectively
used for Level 0 and Level 2. This is the default protection level after an Option bytes
erase or when there is a mismatch in the RDPROT field.
The memory interface saves internally if the device boot in the RAM, or the System
Memory, or the debug features (single-wire) is connected. This information is reset only
with power-down (the system reset or the option loading is not sufficient) or when the
device moves to Level 2. It protects the Flash program memory and data EEPROM.
When this level is enabled:
– No access to the Flash program memory and data EEPROM (read both for fetch
and data and write) and no backup register reading is performed if the debug
features (single-wire), or the device boot in the RAM, or the System memory is
connected. If the user tries to read the Flash memory or data EEPROM, a bus
error is generated. No restriction is present on other areas: it is possible to read
and write/erase the Option bytes area and to execute or read in the System
Memory.
– All operations are possible when the boot is done in the Flash program memory.
– Writing the first Option byte with a value that changes the protection level to Level
0 (it is necessary that byte 0 is 0xAA and byte 2 is 0x55), a mass erase is
generated. The mass erase deletes the Flash program memory and data
EEPROM, deletes the first Option byte and then rewrites it to enable Level 0 and
disable PCROP (WPRMOD = 0), and deletes the backup registers content.
• Level 2: disable debug and chip read protection
Level 2 is set when RDPROT is set to 0xCC. When this level is enabled, it is only
possible to boot from the Flash program memory, and the debug features (single-wire)
are disabled. The Option bytes are protected against write/erase and the protection
level can no longer be changed. The application can write/erase to the Flash program
memory and data EEPROM (it is only possible to boot from the Flash program memory
and execute the customer code) and access the backup registers. When an Option
bytes loading is executed and Level 2 is enabled, old information on debug or boot in
the RAM or System memory are deleted.
Figure 6 resumes the way the protection level can be changed and Table 17 the link
between the values read in the Option bytes and the protection level.
95/1009
DocID025274 Rev 3