EasyManuals Logo

STMicroelectronics STM32WL5 Series User Manual

STMicroelectronics STM32WL5 Series
1450 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #122 background imageLoading...
Page #122 background image
Embedded flash memory (FLASH) RM0453
122/1450 RM0453 Rev 5
4.6.2 Proprietary code readout protection (PCROP)
Two parts 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 CPUs with an
instruction code, while all other accesses (DMA, debug and CPU data read, write and
erase) are strictly prohibited. The PCROP areas have a 1-Kbyte granularity. An additional
option bit (PCROP_RDP) defines if the PCROP area is erased or not when the RDP
protection is changed from level 1 to level 0 (refer to Change the readout protection level).
Each PCROP area is defined by a start page offset and an end page offset into the flash
memory. These offsets are defined in the PCROP address registers (FLASH_PCROP1ASR,
FLASH_PCROP1AER), FLASH_PCROP1BSR and FLASH_PCROP1BER).
A PCROP area is defined from the address:
Flash memory base address + [PCROP1x_STRT x 0x400] (included) to the address
Flash memory base address + [(PCROP1x_END+1) x 0x400] (excluded).
The minimum PCROP area size is two PCROP pages (2 Kbytes)
PCROP1x_END = PCROP1x_STRT + 1.
When PCROP1x_END = PCROP1x_STRT, the full flash memory is PCROP protected.
For example, to protect by PCROP from the address 0x0801 2F80 (included) to the address
0x0801 D004 (included), if boot in flash is selected, one of the FLASH_PCROP1xSR and
FLASH_PCROP1xER registers (x =A or B) must be programmed with:
PCROP1x_STRT = 0x4B (PCROP area first address 0x0801 2C00)
PCROP1x_END = 0x74 (PCROP area last address 0x0801 D3FF)
Any data read access performed through 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.
In the previous example, due to erase by page, all pages from page 0x4B to 0x74 are
protected. In case of page erase, all addresses from 0x0801 2C00 to 0x0801 D3FF cannot
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 areas, the
options programming is launched but PCROP areas stays unchanged. On the contrary, it is
possible to increase the PCROP areas.
When option bit PCROP_RDP is cleared and when the RDP is changing from level 1 to
level 0, the full mass erase is replaced by a partial mass erase to preserve the PCROP area
(refer to Change the readout protection level). In this case, PCROP1x_STRT and
PCROP1x_END (x =A or B) are not erased.
5. SRAM1, SRAM2 and PKA SRAM are erased when RDP changes from level 1 to level 0.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the STMicroelectronics STM32WL5 Series and is the answer not in the manual?

STMicroelectronics STM32WL5 Series Specifications

General IconGeneral
BrandSTMicroelectronics
ModelSTM32WL5 Series
CategoryMicrocontrollers
LanguageEnglish

Related product manuals