Flash Main Memory Erase Sequences; Table 13. Page Erase Overview - ST STM32WL5 Series Reference Manual

Advanced arm-based 32-bit mcus with sub-ghz radio solution
Hide thumbs Also See for STM32WL5 Series:
Table of Contents

Advertisement

RM0453
Note:
FLASH_CR and FLASH_C2CR cannot be written when BSY is set respectively in
FLASH_SR or FLASH_C2SR. Any attempt to write to these registers with BSY set causes
the AHB bus to stall until BSY is cleared.
4.3.7

Flash main memory erase sequences

The Flash memory erase operation can be performed at page level (page erase) or on the
whole memory (mass erase). Mass erase does not affect the information block (system
Flash, OTP and option bytes).
Flash memory page erase
The CPU1 is only able to page erase the non-secure part of the user Flash memory.
The secure CPU2 is able to page erase both the secure and non-secure parts of the user
Flash memory.
A page erase only starts when allowed by PESD in FLASH_SR and FLASH_C2SR.
When a page is protected by PCROP or WRP, it is not erased. Hide protection area and
hide protection area disable provide no protection for erase. A hide protection area when not
protected by PCROP or WRP, can be erased.
PCROP
PCROP WRP
_RDP
No
No
No
Yes
Yes
No
Yes
Yes
No
No
No
Yes
Yes
No
Yes
Yes
1. When PER requested by the non-secure CPU1.
2. When requested by a secure bus master. When requested by a non-secure bus master, no WRPERR is generated and an
illegal access event is generated instead.
To erase a 2-Kbyte page, follow the steps detailed below:
1.
Check that no Flash memory operation is ongoing by checking BSY in FLASH_SR or
FLASH_C2SR.
2.
Check that Flash program and erase operation is allowed by checking PESD in
FLASH_SR or FLASH_C2SR (these checks are recommended even if status may

Table 13. Page erase overview

Comment
Page is erased
Page erase aborted (no page erase started)
Requested by CPU2. Secure page is
x
erased.
Requested by CPU1. Secure page erase is
aborted (no secure page erase started)
Page erase aborted (no page erase started)
RM0453 Rev 1
Embedded Flash memory (FLASH)
CPU1
WRPERR
bus
error
No
No
Yes
N/A
No
No
(2)
Yes
No
CPU2
Illegal
bus
access
error
event
No
No
No
N/A
(1)
Yes
No
105/1461
153

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Table of Contents

Save PDF