RM0440 Rev 4 123/2126
RM0440 Embedded Flash memory (FLASH) for category 3 devices
228
For example, to protect by PCROP from the address 0x0806 2F80 (included) to the address
0x0807 0004 (included):
• if boot in flash is done in Bank 1, FLASH_PCROP1SR and FLASH_PCROP1ER
registers must be programmed with:
– PCROP1_STRT = 0xC5F0.
– PCROP1_END = 0xE000.
• If the two banks are swapped, the protection must apply to bank 2, and
FLASH_PCROP2SR and FLASH_PCROP2ER register must be programmed with:
– PCROP2_STRT = 0xC5F0.
– PCROP2_END = 0xE000.
Any read access performed through the D-bus to a PCROP protected area triggers the
RDERR flag error.
Any PCROP protected address is also write protected and any write access to one of these
addresses triggers WRPERR.
Any PCROP area is also erase protected. Consequently, any erase to a page in this zone is
impossible (including the page containing the start address and the end address of this
zone). Moreover, a software mass erase cannot be performed if one zone is PCROP
protected.
For previous example, due to erase by page, all pages from page 0x62 to 0x70 are
protected in case of page erase. (All addresses from 0x0806 2000 to 0x080 70FFF can’t be
erased).
Deactivation of PCROP can only occurs when the RDP is changing from level 1 to level 0. If
the user options modification tries to clear PCROP or to decrease the PCROP area, the
options programming is launched but PCROP area stays unchanged. On the contrary, it is
possible to increase the PCROP area.
When option bit PCROP_RDP is cleared, when the RDP is changing from level 1 to level 0,
Full Mass Erase is replaced by Partial Mass Erase in order to keep the PCROP area (refer
to Changing the Read protection level). In this case, PCROP1/2_STRT and
PCROP1/2_END are also not erased.
Note: It is recommended to align PCROP area with page granularity when using PCROP_RDP, or
to leave free the rest of the page where PCROP zone starts or ends.
Table 14. PCROP protection
(1)
PCROPx registers values
(x = 1,2)
PCROP protection area
PCROPx_offset_strt >
PCROPx_offset_end
No PCROP area.
PCROPx_offset_strt <
PCROPx_offset_end
The area between PCROPx_offset_strt and PCROPx_offset_end is
protected.
it is possible to write:
– PCROPx_offset_strt with a lower value
– PCROPx_offset_end with a higher value.