Embedded Flash memory (FLASH) for category 2 devices
Table 23. Access status versus protection level and execution modes (continued)
Protection
Area
level
1
Option bytes
2
1
OTP
2
1
Backup
registers
2
1
CCM SRAM
2
1. When the protection level 2 is active, the Debug port, the boot from RAM and the boot from system memory are disabled.
2. The system memory is only read-accessible, whatever the protection level (0, 1 or 2) and execution mode.
3. The Flash main memory is erased when the RDP option byte is programmed with all level protections disabled (0xAA).
4. OTP can only be written once.
5. The backup registers are erased when RDP changes from level 1 to level 0.
6. The CCM SRAM is erased when RDP changes from level 1 to level 0.
4.5.2
Proprietary code readout protection (PCROP)
Apart of the flash memory can be protected against read and write from third parties. The
protected area is execute-only: it can only be reached by the STM32 CPU, as an instruction
code, while all other accesses (DMA, debug and CPU data read, write and erase) are
strictly prohibited. The PCROP area has a double word (64-bit) granularity. An additional
option bit (PCROP_RDP) allows to select if the PCROP area is erased or not when the RDP
protection is changed from Level 1 to Level 0 (refer to
Each PCROP area is defined by a start page offset and an end page offset related to the
physical Flash address. These offsets are defined in the PCROP address registers
PCROP1 Start address register
register
(FLASH_PCROP1ER).
•
The PCROPx (x = 1) area is defined from the address: Flash memory base address +
[PCROPx_STRT x 0x8] (included) to the address: Flash memory base address +
[(PCROPx_END+1) x 0x8] (excluded). The minimum PCROP area size is two double-
words (128 bits).
For example, to protect by PCROP from the address 0x0806 2F80 (included) to the address
0x0807 0004 (included):
•
if boot in flash is selected, FLASH_PCROP1SR and FLASH_PCROP1ER registers
must be programmed with:
–
–
166/2083
User execution (BootFromFlash)
Read
Write
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
PCROP1_STRT = 0xC5F0.
PCROP1_END = 0xE000.
Erase
(3)
Yes
No
No
(4)
N/A
(4)
N/A
Yes
N/A
Yes
N/A
Yes
N/A
Yes
N/A
(FLASH_PCROP1SR),
RM0440 Rev 1
Debug/ BootFromRam/
BootFromLoader
Read
Write
(3)
Yes
Yes
N/A
N/A
No
No
N/A
N/A
No
No
N/A
N/A
No
No
N/A
N/A
Changing the Read protection
Flash PCROP1 End address
RM0440
(1)
Erase
Yes
N/A
N/A
N/A
(5)
No
N/A
(6)
No
N/A
level).
Flash
Need help?
Do you have a question about the STM32G4 Series and is the answer not in the manual?