EasyManuals Logo

ST STM32F40 Series User Manual

ST STM32F40 Series
1422 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 #71 background imageLoading...
Page #71 background image
Embedded Flash memory interface RM0090
71/1422 Doc ID 018909 Rev 4
3.6.2 Programming user option bytes
To run any operation on this sector, the option lock bit (OPTLOCK) in the Flash option
control register (FLASH_OPTCR) must be cleared. To be allowed to clear this bit, you have
to perform the following sequence:
1. Write OPTKEY1 = 0x0819 2A3B in the Flash option key register (FLASH_OPTKEYR)
2. Write OPTKEY2 = 0x4C5D 6E7F in the Flash option key register (FLASH_OPTKEYR)
The user option bytes can be protected against unwanted erase/program operations by
setting the OPTLOCK bit by software.
Modifying user option bytes on STM32F405xx/07xx and STM32F415xx/17xx
To modify the user option value, follow the sequence below:
1. Check that no Flash memory operation is ongoing by checking the BSY bit in the
FLASH_SR register
2. Write the desired option value in the FLASH_OPTCR register.
3. Set the option start bit (OPTSTRT) in the FLASH_OPTCR register
4. Wait for the BSY bit to be cleared.
Note: The value of an option is automatically modified by first erasing the user configuration sector
and then programming all the option bytes with the values contained in the FLASH_OPTCR
register.
Modifying user option bytes on STM32F42xxx and STM32F43xxx
To modify the user option byte value, follow the sequence below:
1. Check that no Flash memory operation is ongoing by checking the BSY bit in the
FLASH_SR register
2. Write the option byte value in the FLASH_OPTCR and/or FLASH_OPTCR1 register.
3. Set the option start bit (OPTSTRT) in the FLASH_OPTCR register
4. Wait for the BSY bit to be cleared
Note: The value of an option byte is automatically modified by first erasing the user configuration
sector and then programming all the option bytes with the values contained in the
FLASH_OPTCR and FLASH_OPTCR1 registers.
Option bytes (word, address 0x1FFE C008)
Bit 15:12 0xF: not used
nWRP: Flash memory write protection option bytes.
Sectors 12 to 23 can be write protected.
Bits 11: 0
nWRPi:
0: Write protection active on sector i.
1: Write protection not active on sector i.
Table 12. Description of the option bytes (STM32F42xxx and STM32F43xxx)

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

ST STM32F40 Series Specifications

General IconGeneral
BrandST
ModelSTM32F40 Series
CategoryMicrocontrollers
LanguageEnglish

Related product manuals