EasyManuals Logo

STMicroelectronics STM32F05 series User Manual

STMicroelectronics STM32F05 series
742 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 #48 background imageLoading...
Page #48 background image
Embedded Flash memory RM0091
48/742 Doc ID 018940 Rev 1
Mass Erase
The Mass Erase command can be used to completely erase the user pages of the Flash
memory. The information block is unaffected by this procedure. The following sequence is
recommended:
1. Check that no Flash memory operation is ongoing by checking the BSY bit in the
FLASH_SR register.
2. Set the MER bit in the FLASH_CR register.
3. Set the STRT bit in the FLASH_CR register.
4. Wait for the BSY bit to be reset.
5. Read all the pages and verify.
Figure 4. Flash memory Mass Erase procedure
Option byte programming
The option bytes are programmed differently from normal user addresses. The number of
option bytes is limited to 6 (2 for write protection, 1 for read protection, 1 for hardware
configuration and 2 free bytes for user data). After unlocking the Flash access, the user has
to authorize the programming of the option bytes by writing the same set of KEYS (KEY1
and KEY2) to the FLASH_OPTKEYR register to set the OPTWRE bit in the FLASH_CR
register (refer to Unlocking the Flash memory for key values). Then the user has to set the
OPTPG bit in the FLASH_CR register and perform a half-word write operation at the desired
Flash address.
Read LOCK bit in
FLASH_CR
LOCK bit in FLASH_CR
=1
Yes
No
Yes
No
Perform unlock sequency
Write MER bit
in FLASH_CR to 1
Write STRT bit in FLASH_CR
to 1
BSY bit in
FLASH_SR
=1
Check the erase operation by
reading all the addresses in
the user memory
MS19222V1

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the STMicroelectronics STM32F05 series and is the answer not in the manual?

STMicroelectronics STM32F05 series Specifications

General IconGeneral
BrandSTMicroelectronics
ModelSTM32F05 series
CategoryMicrocontrollers
LanguageEnglish

Related product manuals