EasyManuals Logo
Home>ST>Microcontrollers>STM32L0x3

ST STM32L0x3 User Manual

ST STM32L0x3
1043 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 #102 background imageLoading...
Page #102 background image
Flash program memory and data EEPROM (FLASH) RM0367
102/1043 RM0367 Rev 7
3.4.5 Protection errors
Write protection error flag (WRPERR)
If an erase/program operation to a write-protected page of the Flash program memory and
data EEPROM is launched, the Write Protection Error flag (WRPERR) is set in the
FLASH_SR register. Consequently, the WRPERR flag is set when the software tries to:
Write to a WRP page.
Write to a System memory page or to factory option bytes.
Write to the Flash program memory, data EEPROM or Option bytes if they are not
unlocked by PEKEY, PRGKEY or OPTKEY.
Write to the Flash program memory, data EEPROM or Option bytes when the RDP
Option byte is set and the device is in debug mode or is booting from the RAM or from
the System memory.
A write-protection error aborts the write/erase operation and an interrupt can be generated
(if ERRIE = 1 in the FLASH_PECR register).
To reset this flag, the software needs to write it to 1.
Read error (RDERR)
If the software tries to read a sector protected by PcROP, the RDERR flag of FLASH_SR is
raised. The data received on the bus is at 0.
If the error interrupt is enabled (ERRIE = 1 in the FLASH_PECR register), an interrupt is
generated.
To reset this flag, the software needs to write it to 1.
3.5 NVM interrupts
Setting the End of programming interrupt enable bit (EOPIE) in the FLASH_PECR register
enables an interrupt generation when an erase or a programming operation ends
successfully. In this case, the End of programming (EOP) bit in the FLASH_SR register is
set. To reset it, the software needs to write it to 1.
Setting the Error interrupt enable bit (ERRIE) in the FLASH_PECR register enables an
interrupt generation if an error occurs during a programming or an erase operation request.
In this case, one or several error flags are set in the FLASH_SR register:
RDERR (PCROP Read protection error flags)
WRPERR (Write protection error flags)
PGAERR (Programming alignment error flag)
OPTVERR (Option validity error flag)
SIZERR (Size error flag)
FWWERR (Fetch while write error flag)
NOTZEROERR (Write a not zero word error flag)
To reset the error flag, the software needs to write the right flag to 1.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ST STM32L0x3 and is the answer not in the manual?

ST STM32L0x3 Specifications

General IconGeneral
BrandST
ModelSTM32L0x3
CategoryMicrocontrollers
LanguageEnglish

Related product manuals