4. Embedded Flash memory (FLASH)

4.1 Introduction

The embedded Flash memory (FLASH) manages the accesses of any master to the 1 Mbyte of embedded non-volatile memory. It implements the read, program and erase operations, error corrections as well as various integrity and confidentiality protection mechanisms.

The embedded Flash memory manages the automatic loading of non-volatile user option bytes at power-on reset, and implements the dynamic update of these options.

4.2 FLASH main features

4.3 FLASH functional description

4.3.1 FLASH block diagram

Figure 5 shows the embedded Flash memory block diagram.

Figure 5. FLASH block diagram. The diagram shows the internal architecture of the FLASH memory. On the left, a 32-bit AHB bus connects to an AHB Interface Configuration port, which in turn connects to Register banks. Below the AHB bus, a 64-bit AXI bus connects to an AXI Interface System bus. The AXI Interface System bus connects to Flash Interface Logic. The Flash Interface Logic connects to a Non-volatile Memory Bank. The Flash Interface Logic also connects to IRQ Logic, which outputs the flash_it signal. The Register banks also connect to the Flash Interface Logic. The Non-volatile Memory Bank is connected to the Flash Interface Logic via 256-bit data lines, ECC, redundancy, and Control, Status lines. External signals sys_ck, d1_rst, and po_rst are shown entering the FLASH block from the top and bottom respectively.

Figure 5. FLASH block diagram

MSV62495V1

Figure 5. FLASH block diagram. The diagram shows the internal architecture of the FLASH memory. On the left, a 32-bit AHB bus connects to an AHB Interface Configuration port, which in turn connects to Register banks. Below the AHB bus, a 64-bit AXI bus connects to an AXI Interface System bus. The AXI Interface System bus connects to Flash Interface Logic. The Flash Interface Logic connects to a Non-volatile Memory Bank. The Flash Interface Logic also connects to IRQ Logic, which outputs the flash_it signal. The Register banks also connect to the Flash Interface Logic. The Non-volatile Memory Bank is connected to the Flash Interface Logic via 256-bit data lines, ECC, redundancy, and Control, Status lines. External signals sys_ck, d1_rst, and po_rst are shown entering the FLASH block from the top and bottom respectively.

4.3.2 FLASH internal signals

Table 13 describes a list of the useful to know internal signals available at embedded Flash memory level. These signals are not available on the microcontroller pads.

Table 13. FLASH internal input/output signals

Internal signal nameSignal typeDescription
sys_ckInputD1 domain bus clock (embedded Flash memory AXI interface clock)
po_rstInputPower on reset
d1_rstInputD1 domain system reset
flash_itOutputEmbedded flash interface interrupt request

4.3.3 FLASH architecture and integration in the system

The embedded Flash memory is a central resource for the whole microcontroller. It serves as an interface to one non-volatile memory bank, and organizes the memory in a very specific way. The embedded Flash memory also proposes a set of security features to protect the assets stored in the non-volatile memory at boot time, at run-time and during firmware and configuration upgrades.

The embedded Flash memory offers one 64-bit AXI slave ports for code and data accesses, plus a 32-bit AHB configuration slave port used for register bank accesses.

Note: The application can simultaneously request a read and a write operation through the AXI interface.

The embedded Flash microarchitecture is shown in Figure 6 .

Figure 6. Detailed FLASH architecture

Figure 6. Detailed FLASH architecture diagram. The diagram shows the internal architecture of the embedded Flash memory. On the left, the 'System bus' is divided into a '32-bit AHB bus' and a '64-bit AXI bus'. The AHB bus connects to an 'AHB Interface' which is linked to 'Banked registers'. The AXI bus connects to an 'AXI Interface' which includes 'Write data buffer' and 'Read data buffer' components. These buffers feed into 'Flash interface logic' which contains 'IRQ Logic', a 'CRC module', an 'Erase queue', three 'Read queue (x3)' units, and two 'Write queue (x2)' units. The queues feed into an 'FSM' (Finite State Machine). The FSM connects to a 'Non-volatile memory interface' which is linked to a 'Flash memory Bank'. The interface also includes a '256-bit' data path and an 'ECC' (Error Correction Code) module. The entire internal structure is labeled 'FLASH' at the bottom right. A small code 'MSv62496V1' is visible in the bottom right corner of the diagram area.
Figure 6. Detailed FLASH architecture diagram. The diagram shows the internal architecture of the embedded Flash memory. On the left, the 'System bus' is divided into a '32-bit AHB bus' and a '64-bit AXI bus'. The AHB bus connects to an 'AHB Interface' which is linked to 'Banked registers'. The AXI bus connects to an 'AXI Interface' which includes 'Write data buffer' and 'Read data buffer' components. These buffers feed into 'Flash interface logic' which contains 'IRQ Logic', a 'CRC module', an 'Erase queue', three 'Read queue (x3)' units, and two 'Write queue (x2)' units. The queues feed into an 'FSM' (Finite State Machine). The FSM connects to a 'Non-volatile memory interface' which is linked to a 'Flash memory Bank'. The interface also includes a '256-bit' data path and an 'ECC' (Error Correction Code) module. The entire internal structure is labeled 'FLASH' at the bottom right. A small code 'MSv62496V1' is visible in the bottom right corner of the diagram area.

Behind the system interfaces, the embedded Flash memory implements various command queues and buffers to perform Flash read, write and erase operations with maximum efficiency.

Thanks to the addition of a read and write data buffer, the AXI slave port handles the following access types:

The AHB configuration slave port supports 8-bit, 16-bit and 32-bit word accesses.

The embedded Flash memory is built in such a way that only one read or write operation can be executed at a time.

4.3.4 Flash memory architecture and usage

Flash memory architecture

Figure 7 shows the non-volatile memory organization supported by the embedded Flash memory.

Figure 7. Embedded Flash memory organization

Diagram of Embedded Flash memory organization showing the internal structure of the Flash memory block, including sectors, system memory, and option bytes, connected to the AXI system bus and AHB config port.

The diagram illustrates the internal architecture of the embedded Flash memory. On the left, a vertical bar represents the Flash Interface Logic . It is connected to an AXI system bus at the top and an AHB config port at the bottom. To the right of the interface logic, the memory is organized into three main regions:

On the far left, three colored boxes indicate protection levels for the sectors: "Secure-only" (pink), "Write-protected" (blue), and "PCROP-protected" (green). The sectors are color-coded: Sector 0 (blue), Sector 1 (blue), Sector 2 (blue), Sector 3 (pink), Sector 4 (blue), Sector 5 (blue), Sector 6 (green), and Sector 7 (blue). The identifier "MSv62497V1" is located in the bottom right corner of the diagram.

Diagram of Embedded Flash memory organization showing the internal structure of the Flash memory block, including sectors, system memory, and option bytes, connected to the AXI system bus and AHB config port.

The embedded Flash non-volatile memory is composed of:

The embedded Flash memory interface logic supports the following architecture partitioning:

The overall Flash memory architecture is summarized in Table 15 .

Table 14. Flash memory organization (STM32H730 devices)

Flash memory areaAddress rangeSize (bytes)Region nameAccess interfaceSNB (1)
User main memory0x0800 0000- 0x0801 FFFF128 KSector 0AXI ports0x0
System memory0x1FF0 0000- 0x1FF1 FFFF128 KSystem Flash memory (read-only)N/A (2)
Option bytesN/A-User option bytesRegisters onlyN/A
  1. 1. SNB contains the target sector number for an erase operation. See Section 4.3.10 for details.
  2. 2. Cannot be erased by software.

Table 15. Flash memory organization (STM32H723/733 and STM32H725/735 devices)

Flash memory areaAddress rangeSize (bytes)Region name (1)Access interfaceSNB (2)
User main memory0x0800 0000- 0x0801 FFFF128 KSector 0AXI ports0x0
0x0802 0000- 0x0803 FFFF128 KSector 10x1
............
0x080E 0000- 0x080F FFFF128 KSector 70x7
System memory0x1FF0 0000- 0x1FF1 FFFF128 KSystem Flash memory (read-only)N/A (3)
Option bytesN/A-User option bytesRegisters onlyN/A
  1. 1. For devices with 512 Kbytes of Flash memory, only sectors 0 to 3 are available.
  2. 2. SNB contains the target sector number for an erase operation. See Section 4.3.10 for details.
  3. 3. Cannot be erased by software.

Partition usage

Figure 8 shows how the embedded Flash memory is used both by STMicroelectronics and the application software.

Figure 8. Embedded Flash memory usage

Figure 8: Embedded Flash memory usage diagram showing memory partitioning for STM32 Standard mode and Secure access mode.

The diagram illustrates the memory layout for two STM32 modes: Standard mode and Secure access mode. A vertical axis on the left indicates memory addresses, with a 'secure area' at the top. The memory is divided into several regions:

A red arrow labeled 'Boot address "0" or "1"' points to the boundary between User memory and System memory. Another red arrow labeled 'jump' points from the 'Secure bootloader' to the 'Application secure software'.

Figure 8: Embedded Flash memory usage diagram showing memory partitioning for STM32 Standard mode and Secure access mode.

User and system memories are used differently according to whether the microcontroller is configured by the application software in Standard mode or in Secure access mode. This selection is done through the SECURITY option bit (see Section 4.4.6 ):

In Secure access mode, the microcontroller always boots into the secure bootloader code (unique entry point). Then, if no secure services are required, this code securely jumps to the requested boot address configured through the BOOT pin and the option bytes, as shown in Figure 8 (see Section 5: Secure memory management (SMM) for details).

Note: For more information on option byte setup for boot, refer to Section 4.4.7 .

Additional partition usage is the following:

Note: For further information on STM32 bootloader flashing by STMicroelectronics, refer to application note AN2606 “STM32 microcontroller system memory boot mode” available from http://www.st.com .

4.3.5 FLASH system performance enhancements

The embedded Flash memory uses read and write command queues in order to enhance Flash operations.

4.3.6 FLASH data protection schemes

Figure 9 gives an overview of the protection mechanisms supported by the embedded Flash memory. A PCROP and a secure-only area can be defined in the Flash memory bank. The properties of these protected areas are detailed in Section 4.5 .

Figure 9. FLASH protection mechanisms

Diagram of FLASH protection mechanisms showing memory sectors and protection areas.

The diagram illustrates the memory layout and protection mechanisms. At the bottom, a box labeled 'System flash' is marked 'Write locked by ST'. Above it, memory is divided into 8 sectors (Sector 0 to Sector 7). Sector 0 is at the bottom, and Sector 7 is at the top. Two protection areas are defined by start and end addresses:

On the left, a vertical double-headed arrow distinguishes between 'user' (top) and 'sys' (bottom) access. A bracket labeled 'User option Bytes' points to the memory location for these bytes. A legend at the top left shows a purple square for 'secure access only (SEC)' and a green square for 'execute only, no read access (PCROP)'. The diagram is labeled 'MSv62499V1' in the bottom right corner.

Diagram of FLASH protection mechanisms showing memory sectors and protection areas.

4.3.7 Overview of FLASH operations

Read operations

The embedded Flash memory can perform read operations on the whole non-volatile memory using various granularities: 64 bits, 32 bits, 16 bits or one byte. User and system Flash memories are read through the AXI interface, while the option bytes are read through the register interface.

To increase efficiency, the embedded Flash memory implements the buffering of consecutive read requests.

For more details on read operations, refer to Section 4.3.8: FLASH read operations .

Program/erase operations

The embedded Flash memory supports the following program and erase operations:

Note: Program and erase operations are subject to the various protection that could be set on the embedded Flash memory, such as write protection and global readout protection (see next sections for details).

To increase efficiency, the embedded Flash memory implements the buffering of consecutive write accesses.

For more details refer to Section 4.3.9: FLASH program operations and Section 4.3.10: FLASH erase operations .

Protection mechanisms

The embedded Flash memory supports different protection mechanisms:

For more details refer to Section 4.5: FLASH protection mechanisms .

Option byte loading

Under specific conditions, the embedded Flash memory reliably loads the non-volatile option bytes stored in non-volatile memory, thus enforcing boot and security options to the whole system when the embedded Flash memory becomes functional again. For more details refer to Section 4.4: FLASH option bytes .

4.3.8 FLASH read operations

Read operation overview

The embedded Flash memory supports the execution of one read command while two are waiting in the read command queue. Multiple read access types are also supported as defined in Section 4.3.3: FLASH architecture and integration in the system .

The read commands are associated with a 256-bit read data buffer.

Note: The embedded Flash memory can perform single error correction and double error detection while read operations are being executed (see Section 4.3.11: Flash memory error protections ).

The AXI interface read channel operates as follows:

triggering additional Flash read operations. This mechanism occurs each time a read access is granted. When a read access is rejected for security reasons (e.g. PCROP protected word), the corresponding read error response is issued by the embedded Flash memory and no read operation to Flash memory is triggered.

The Read pipeline architecture is summarized in Figure 10 .

For more information on bus interfaces, refer to Section 4.3.3: FLASH architecture and integration in the system .

Figure 10. FLASH read pipeline architecture

Figure 10. FLASH read pipeline architecture diagram showing the internal components and data flow for reading from Flash memory.

The diagram illustrates the internal architecture of the FLASH read pipeline. On the left, a 'System bus' (labeled '64-bit AXI bus') connects to an 'AXI Interface'. The 'AXI Interface' sends a 'Read command' to the 'Flash Interface Logic' and receives 'Read data' from a 'Read data buffer'. The 'Flash Interface Logic' contains a 'Read queue (x3)' and a 'Write queue (x2)'. A 'FSM' (Finite State Machine) is connected to the queues and the 'Non-volatile memory interface'. The 'Non-volatile memory interface' sends a 'ready' signal to the FSM and receives data from a 'Flash Bank' via a '256-bit' bus. The 'Flash Bank' also provides 'ECC' (Error Correction Code) data. The entire internal structure is labeled 'FLASH' at the bottom right. The identifier 'MSv63801V1' is present in the bottom right corner of the diagram.

Figure 10. FLASH read pipeline architecture diagram showing the internal components and data flow for reading from Flash memory.

Single read sequence

The recommended simple read sequence is the following:

  1. 1. Freely perform read accesses to any AXI-mapped area.
  2. 2. The embedded Flash memory effectively executes the read operation from the read command queue buffer as soon as the non-volatile memory is ready and the previously requested operations have been served.

Adjusting read timing constraints

The embedded Flash memory clock must be enabled and running before reading data from non-volatile memory.

To correctly read data from Flash memory, the number of wait states (LATENCY) must be correctly programmed in the Flash access control register (FLASH_ACR) according to the embedded Flash memory AXI interface clock frequency (sys_ck) and the internal voltage range of the device ( \( V_{core} \) ).

Table 16 shows the correspondence between the number of wait states (LATENCY), the programming delay parameter (WRHIGHFREQ), the embedded Flash memory clock frequency and its supply voltage ranges.

Table 16. FLASH recommended number of wait states and programming delay

Number of wait states (LATENCY)Programming delay (WRHIGHFREQ)AXI Interface clock frequency vs V CORE range
VOS3 range
0.95 V - 1.05 V
VOS2 range
1.05 V - 1.15 V
VOS1 range
1.15 V - 1.26 V
VOS0 range
1.26 V - 1.40 V
0 WS (1 FLASH clock cycle)00[0;35 MHz][0 MHz;50 MHz][0 MHz;67 MHz][0 MHz;70 MHz]
1 WS (2 FLASH clock cycles)01]35 MHz;70 MHz]]50 MHz;100 MHz]]67 MHz;133 MHz]]70 MHz;140 MHz]
2 WS (3 FLASH clock cycles)10]70 MHz;85 MHz]]100 MHz;150 MHz]]133 MHz;200 MHz]]140 MHz;210 MHz]
3 WS (4 FLASH clock cycles)11---]210 MHz;275 MHz]

Adjusting system frequency

After power-on, a default 7 wait-state latency is specified in FLASH_ACR register, in order to accommodate AXI interface clock frequencies with a safety margin (see Table 16 ).

When changing the AXI bus frequency, the application software must follow the below sequence in order to tune the number of wait states required to access the non-volatile memory.

To increase the embedded Flash memory clock source frequency:

  1. 1. If necessary, program the LATENCY and WRHIGHFREQ bits to the right value in the FLASH_ACR register, as described in Table 16 .
  2. 2. Check that the new number of wait states is taken into account by reading back the FLASH_ACR register.
  3. 3. Modify the embedded Flash memory clock source and/or the AXI bus clock prescaler in the RCC_CFGR register of the reset and clock controller (RCC).
  4. 4. Check that the new embedded Flash memory clock source and/or the new AXI bus clock prescaler value are taken in account by reading back the embedded Flash memory clock source status and/or the AXI bus prescaler value in the RCC_CFGR register of the reset and clock controller (RCC).

To decrease the embedded Flash memory clock source frequency:

  1. 1. Modify the embedded Flash memory clock source and/or the AXI bus clock prescaler in the RCC_CFGR register of reset and clock controller (RCC).
  2. 2. Check that the embedded Flash memory new clock source and/or the new AXI bus clock prescaler value are taken into account by reading back the embedded Flash
  1. memory clock source status and/or the AXI interface prescaler value in the RCC_CFGR register of reset and clock controller (RCC).
    1. 3. If necessary, program the LATENCY and WRHIGHFREQ bits to the right value in FLASH_ACR register, as described in Table 16 .
    2. 4. Check that the new number of wait states has been taken into account by reading back the FLASH_ACR register.

Error code correction (ECC)

The embedded Flash memory embeds an error correction mechanism. Single error correction and double error detection are performed for each read operation. For more details, refer to Section 4.3.11: Flash memory error protections .

Read errors

When the ECC mechanism is not able to correct the read operation, the embedded Flash memory reports read errors as described in Section 4.7.7: Error correction code error (SNECCERR/DBECCERR) .

Read interrupts

See Section 4.8: FLASH interrupts for details.

4.3.9 FLASH program operations

Program operation overview

The virgin state of each non-volatile memory bitcell is 1. The embedded Flash memory supports programming operations that can change (reset) any memory bitcell to 0. However these operations do not support the return of a bit to its virgin state. In this case an erase operation of the entire sector is required.

A program operation consists in issuing write commands. The embedded Flash memory supports the execution of one write command while one command is waiting in the write command queue. Since a 10-bit ECC code is associated to each 256-bit data Flash word, only write operations by 256 bits are executed in the non-volatile memory.

Note: The application can decide to write as little as 8 bits to a Flash word. In this case, a force-write mechanism to the 256 bits + ECC is used (see FW bit of FLASH_CR register). System Flash memory cannot be written by the application software.

It is not recommended to overwrite a Flash word that is not virgin. The result may lead to an inconsistent ECC code that will be systematically reported by the embedded Flash memory, as described in Section 4.7.7: Error correction code error (SNECCERR/DBECCERR) .

The AXI interface write channel operates as follows:

The write pipeline architecture is described in Figure 11 .

For more information on bus interfaces, refer to Section 4.3.3: FLASH architecture and integration in the system .

Figure 11. FLASH write pipeline architecture

Figure 11. FLASH write pipeline architecture diagram showing the flow of data from the system bus through the AXI interface, write queue, and non-volatile memory interface to the Flash Bank.

The diagram illustrates the FLASH write pipeline architecture. On the left, a 'System bus' (labeled '64-bit AXI bus') connects to an 'AXI Interface'. The AXI Interface sends 'Write command' and 'Write data' (via a 'Write data buffer') to 'Flash Interface Logic'. The Flash Interface Logic contains a 'Read queue (x3)' and a 'Write queue (x2)'. A 'FSM' (Finite State Machine) within the logic sends a 'ready' signal to the 'Non-volatile memory interface'. The AXI Interface also receives a 'Write response' from the Flash Interface Logic. The Non-volatile memory interface sends '256-bit' data and 'ECC' (Error Correction Code) to the 'Flash Bank'. The entire FLASH memory system is labeled 'FLASH' at the bottom right. A reference code 'MSV63800V1' is present in the bottom right corner of the diagram.

Figure 11. FLASH write pipeline architecture diagram showing the flow of data from the system bus through the AXI interface, write queue, and non-volatile memory interface to the Flash Bank.

Managing write protections

Before programming a user sector, the application software must check the protection of the targeted Flash memory area.

The embedded Flash memory checks the protection properties of the write transaction target at the output of the write queue buffer, just before the effective write operation to the non-volatile memory:

Note: No write protection check is performed when the embedded Flash memory accepts AXI write requests.

The write protection flag does not need to be cleared before performing a new programming operation.

Monitoring ongoing write operations

The application software can use three status flags located in FLASH_SR in order to monitor ongoing write operations.

Enabling write operations

Before programming the user flash, the application software must make sure that PG bit is set to 1 in FLASH_CR. If it is not the case, an unlock sequence must be used (see Section 4.5.1: FLASH configuration protection ) and the PG bit must be set.

When the option bytes need to be modified or a mass erase needs to be started, the application software must make sure that FLASH_OPTCR is unlocked. If it is not the case, an unlock sequence must be used (see Section 4.5.1: FLASH configuration protection ).

Note: The application software must not unlock a register that is already unlocked, otherwise this register will remain locked until next system reset.

If needed, the application software can update the programming delay and programming parallelism as described at the end of this section.

Single write sequence

The recommended single write sequence is the following:

  1. 1. Unlock the FLASH_CR register, as described in Section 4.5.1: FLASH configuration protection (only if register is not already unlocked).
  2. 2. Enable write operations by setting the PG bit in the FLASH_CR register.
  3. 3. Check the protection of the targeted memory area.
  4. 4. Write one Flash-word corresponding to 32-byte data starting at a 32-byte aligned address.
  5. 5. Check that QW has been raised and wait until it is reset to 0.

If step 4 is executed incrementally (e.g. byte per byte), the write buffer can become partially filled. In this case the application software can decide to force-write what is stored in the write buffer by using FW bit in FLASH_CR register. In this particular case, the unwritten bits are automatically set to 1. If no bit in the write buffer is set to 0, the FW bit has no effect.

Note: Using a force-write operation prevents the application from updating later the missing bits with a value different from 1, which is likely to lead to a permanent ECC error.

Any write access requested while the PG bit is set to 0 is rejected. In this case, no error is generated on the bus, but the PGSERR flag is raised.

Clearing the programming sequence error (PGSERR) and inconsistency error (INCERR) is mandatory before attempting a write operation (see Section 4.7: FLASH error management for details).

Adjusting programming timing constraints

Program operation timing constraints depend of the embedded Flash memory clock frequency, which directly impacts the performance. If timing constraints are too tight, the non-volatile memory will not operate correctly, if they are too lax, the programming speed will not be optimal.

The user must therefore trim the optimal programming delay through the WRHIGHFREQ parameter in the FLASH_ACR register. Refer to Table 16 in Section 4.3.8: FLASH read operations for the recommended programming delay depending on the embedded Flash memory clock frequency.

The application software must check that no program/erase operation is ongoing before modifying WRHIGHFREQ parameter.

Adjusting programming parallelism

The parallelism is the maximum number of bits that can be written to 0 in one shot during a write operation. The programming parallelism is also used during sector and bank erase.

There is no hardware limitation on programming parallelism. The user can select different parallelisms depending on the application requirements: the lower the parallelism, the lower the peak consumption during a programming operation, but the longer the execution time.

The parallelism is configured through the PSIZE1/2 bits in FLASH_CR1/2 register.

Table 17. FLASH parallelism parameter

PSIZEParallelism
008 bits (one byte)
0116 bits
1032 bits
1164 bits

Programming errors

When a program operation fails, an error can be reported as described in Section 4.7: FLASH error management .

Programming interrupts

See Section 4.8: FLASH interrupts for details.

4.3.10 FLASH erase operations

Erase operation overview

The embedded Flash memory can perform erase operations on 128-Kbyte user sectors.

Note: System Flash cannot be erased by the application software.

The erase operation forces all non-volatile bit cells to high state, which corresponds to the virgin state. It clears existing data and corresponding ECC, allowing a new write operation to be performed. If the application software reads back a word that has been erased, all the bits will be read at 1, without ECC error.

Erase operations are similar to read or program operations except that the commands are queued in a special buffer (a two-command deep erase queue).

Erase commands are issued through the AHB configuration interface. If the embedded Flash memory receives simultaneously a write and an erase request, both operations are accepted but the write operation is executed first.

Erase and security

A user sector can be erased only if it does not contain PCROP, secure-only or write-protected data (see Section 4.5: FLASH protection mechanisms for details). In other words, if the application software attempts to erase a user sector with at least one Flash word that is protected, the sector erase operation is aborted and the WRPERR flag is raised in the FLASH_SR register, as described in Section 4.7.2: Write protection error (WRPERR) .

The embedded Flash memory allows the application software to perform an erase followed by an automatic protection removal (PCROP, secure-only area and write protection), as described hereafter.

Enabling erase operations

Before erasing a sector, the application software must make sure that FLASH_CR is unlocked. If it is not the case, an unlock sequence must be used (see Section 4.5.1: FLASH configuration protection ).

Note: The application software must not unlock a register that is already unlocked, otherwise this register will remain locked until next system reset.

Similar constraints apply to bank erase requests.

Flash sector erase sequence

To erase a 128-Kbyte user sector, proceed as follows:

  1. 1. Check and clear (optional) all the error flags due to previous programming/erase operation. Refer to Section 4.7: FLASH error management for details.
  2. 2. Unlock the FLASH_CR register, as described in Section 4.5.1: FLASH configuration protection (only if register is not already unlocked).
  3. 3. Set the SER bit and SNB bitfield in the corresponding FLASH_CR register. SER indicates a sector erase operation, while SNB contains the target sector number.
  4. 4. Set the START bit in the FLASH_CR register.
  5. 5. Wait for the QW bit to be cleared in the corresponding FLASH_SR register.

Note: If a bank erase is requested simultaneously to the sector erase (BER bit set), the bank erase operation supersedes the sector erase operation.

Standard Flash bank erase sequence

To erase all bank sectors except for those containing secure-only and protected data, proceed as follows:

  1. 1. Check and clear (optional) all the error flags due to previous program/erase operation. Refer to Section 4.7: FLASH error management for details.
  2. 2. Unlock the FLASH_CR register, as described in Section 4.5.1: FLASH configuration protection (only if the register is not already unlocked).
  3. 3. Set the BER bit in the FLASH_CR register.
  4. 4. Set the START bit in the FLASH_CR register to start the bank erase operation. Then wait until the QW bit is cleared in the corresponding FLASH_SR register.

Note: BER and START bits can be set together, so above steps 3 and 4 can be merged.

If a sector erase is requested simultaneously to the bank erase (SER bit set), the bank erase operation supersedes the sector erase operation.

Flash bank erase with automatic protection-removal sequence

To erase all bank sectors including those containing secure-only and protected data without performing an RDP regression (see Section 4.5.3 ), proceed as follows:

  1. 1. Check and clear (optional) all the error flags due to previous programming/erase operation. Refer to Section 4.7: FLASH error management for details.
  2. 2. Unlock FLASH_OPTCR register, as described in Section 4.5.1: FLASH configuration protection (only if register is not already unlocked).
  3. 3. If a PCROP-protected area exists set DMEP bit in FLASH_PRAR_PRG register. In addition, program the PCROP area end and start addresses so that the difference is negative, i.e. \( PROT\_AREA\_END < PROT\_AREA\_START \) .
  4. 4. If a secure-only area exists set DMES bit in FLASH_SCAR_PRG register. In addition, program the secure-only area end and start addresses so that the difference is negative, i.e. \( SEC\_AREA\_END < SEC\_AREA\_START \) .
  5. 5. Set all WRPSn1/2 bits in FLASH_WPSN_PRG to 1 to disable all sector write protection.
  6. 6. Unlock FLASH_CR register, only if register is not already unlocked.
  7. 7. Set the BER bit in the FLASH_CR register.
  8. 8. Set the START bit in the FLASH_CR register to start the bank erase with protection removal operation. Then wait until the QW bit is cleared in the corresponding FLASH_SR register. At that point a bank erase operation has erased the whole bank including the sectors containing PCROP-protected and/or secure-only data, and an option byte change has been automatically performed so that all the protections are disabled.

Note: BER and START bits can be set together, so above steps 8 and 9 can be merged.

Be aware of the following warnings regarding to above sequence:

4.3.11 Flash memory error protections

Error correction codes (ECC)

The embedded Flash memory supports an error correction code (ECC) mechanism. It is based on the SECDED algorithm in order to correct single errors and detects double errors.

This mechanism uses 10 ECC bits per 256-bit Flash word, and applies to user and system Flash memory.

More specifically, during each read operation from a 256-bit Flash word, the embedded Flash memory also retrieves the 10-bit ECC information, computes the ECC of the Flash word, and compares the result with the reference value. If they do not match, the corresponding ECC error is raised as described in Section 4.7.7: Error correction code error (SNECCERR/DBECCERR) .

During each program operation, a 10- bit ECC code is associated to each 256-bit data Flash word, and the resulting 266-bit Flash word information is written in non-volatile memory.

Cyclic redundancy codes (CRC)

The embedded Flash memory implements a cyclic redundancy check (CRC) hardware module. This module checks the integrity of a given user Flash memory area content (see Figure 6: Detailed FLASH architecture ).

The area processed by the CRC module can be defined either by sectors or by start/end addresses. It can also be defined as the whole bank (user Flash memory area only).

When enabled, the CRC hardware module performs multiple reads by chunks of 4, 16, 64 or 256 consecutive Flash-word (i.e. chunks of 128, 512, 2048 or 8192 bytes). These consecutive read operations are pushed by the CRC module into the required read command queue together with other AXI read requests, thus avoiding to deny AXI read commands.

CRC computation uses CRC-32 (Ethernet) polynomial 0x4C11DB7:

\[ X^{32} + X^{26} + X^{23} + X^{22} + X^{16} + X^{12} + X^{11} + X^{10} + X^8 + X^7 + X^5 + X^4 + X^2 + X + 1 \]

The CRC operation is concurrent with option byte change as the same hardware is used for both operations. To avoid the CRC computation from being corrupted, the application shall complete the option byte change (by reading the result of the change) before running a CRC operation, and vice-versa.

The sequence recommended to configure a CRC operation is the following:

  1. 1. Unlock FLASH_CR register, if not already unlocked.
  2. 2. Enable the CRC feature by setting the CRC_EN bit in FLASH_CR.
  3. 3. Program the desired data size in the CRC_BURST field of FLASH_CRCCR.
  4. 4. Define the user Flash area on which the CRC has to be computed. Two solutions are possible:
    • – Define the area start and end addresses by programming FLASH_CRCSTARTADDR and FLASH_CRCENDADDR, respectively,
    • – or select the targeted sectors by setting the CRC_BY_SECT bit in FLASH_CRCCR and by programming consecutively the target sector numbers in the CRC_SECT field of the FLASH_CRCCR register. Set ADD_SECT bit after each CRC_SECT programming.
  5. 5. Start the CRC operation by setting the START_CRC bit.
  6. 6. Wait until the CRC_BUSY flag is reset in FLASH_SR register.
  7. 7. Retrieve the CRC result in the FLASH_CRCDATAR register.

The CRC can be computed for the whole bank by setting the ALL_BANK bit in the FLASH_CRCCR register.

Note: The application should avoid running a CRC on PCROP- or secure-only user Flash area since it may alter the expected CRC value. A special error flag defined in Section 4.7.10: CRC read error (CRCRDERR) can be used to detect such a case.

CRC computation does not raise standard read error flags such as RDSERR, RDPERR and DBECCERR. Only CRCRDERR is raised.

4.3.12 FLASH reset and clocks

Reset management

The embedded Flash memory can be reset by a D1 domain reset (d1_rst), driven by the reset and clock control (RCC). The main effects of this reset are the following:

The embedded Flash memory can be reset by a power-on reset (po_rst), driven by the reset and clock control (RCC). When the reset falls, all option byte registers are reset. When the reset rises up, the option bytes are loaded, potentially applying new features. During this loading sequence, the device remains under reset and the embedded Flash memory is not accessible.

The Reset signal can have a critical impact on the embedded Flash memory:

Clock management

The embedded Flash memory uses the microcontroller system clock (sys_ck), here the AXI interface clock.

Depending on the device clock and internal supply voltage, specific read and write latency settings usually need to be set in the Flash access control register (FLASH_ACR), as explained in Section 4.3.8: FLASH read operations and Section 4.3.9: FLASH program operations .

4.4 FLASH option bytes

4.4.1 About option bytes

The embedded Flash memory includes a set of non-volatile option bytes. They are loaded at power-on reset and can be read and modified only through configuration registers.

These option bytes are configured by the end-user depending on the application requirements. Some option bytes might have been initialized by STMicroelectronics during manufacturing stage.

This section documents:

4.4.2 Option byte loading

There are multiple ways of loading the option bytes into embedded Flash memory:

1. Power-on wakeup

When the device is first powered, the embedded Flash memory automatically loads all the option bytes. During the option byte loading sequence, the device remains under reset and the embedded Flash memory cannot be accessed.

2. Wakeup from system Standby

When the D1 power domain, which contains the embedded Flash memory, is switched from DStandby mode to DRun mode, the embedded Flash memory behaves as during a power-on sequence.

3. Ad-hoc option byte reloading by the application

When the user application successfully modifies the option byte content through the embedded Flash memory registers, the non-volatile option bytes are programmed and the embedded Flash memory automatically reloads all option bytes to update the option registers.

Note: The option bytes read sequence is enhanced thanks to a specific error correction code. In case of security issue, the option bytes may be loaded with default values (see Section 4.4.3: Option byte modification ).

4.4.3 Option byte modification

Changing user option bytes

A user option byte change operation can be used to modify the configuration and the protection settings saved in the non-volatile option byte area.

The embedded Flash memory features two sets of option byte registers:

When the OPTLOCK bit in FLASH_OPTCR register is set, modifying the _PRG registers is not possible.

When OPTSTART bit is set to 1, the embedded Flash memory checks if at least one option byte needs to be programmed by comparing the current values (_CUR) with the new ones (_PRG). If this is the case and all the other conditions are met (see Changing security option bytes ), the embedded Flash memory launches the option byte modification in its non-volatile memory and updates the option byte registers with _CUR extension.

If one of the condition described in Changing security option bytes is not respected, the embedded Flash memory sets the OPTCHANGEERR flag to 1 in the FLASH_OPTSR_CUR register and aborts the option byte change operation. In this case, the _PRG registers are not overwritten by current option value. The user application can check what was wrong in their configuration.

Unlocking the option byte modification

After reset, the OPTLOCK bit is set to 1 and the FLASH_OPTCR is locked. As a result, the application software must unlock the option configuration register before attempting to change the option bytes. The FLASH_OPTCR unlock sequence is described in Section 4.5.1: FLASH configuration protection .

Option byte modification sequence

To modify user option bytes, follow the sequence below:

  1. 1. Unlock FLASH_OPTCR register as described in Section 4.5.1: FLASH configuration protection , unless the register is already unlocked.
  2. 2. Write the desired new option byte values in the corresponding option registers (FLASH_XXX_PRG).
  3. 3. Set the option byte start change OPTSTART bit to 1 in the FLASH_OPTCR register.
  4. 4. Wait until OPT_BUSY bit is cleared.

Note: If a reset or a power-down occurs while the option byte modification is ongoing, the original option byte value is kept. A new option byte modification sequence is required to program the new value.

Changing security option bytes

On top of OPTLOCK bit, there is a second level of protection for security-sensitive option byte fields. Specific rules must be followed to update them:

A detailed description of RDP option bits is given in Section 4.5.3 . The following rules must be respected to modify these option bits:

These option bytes manage sector write protection in FLASH_WPSN_CUR1/2R registers. They can be changed without any restriction when the RDP protection level is different from level 2.

These option bytes configure the size of the PCROP areas in FLASH_PRAR_CUR registers. They can be increased without any restriction by the Arm ® Cortex ® -M7 core. To remove or reduce a PCROP area, an RDP level 1 to 0 regression (see Section 4.5.3 ) or a bank erase with protection removal (see Section 4.3.10 ) must be

requested at the same time. DMEP must be set to 1 in either FLASH_PRAR_CUR or FLASH_PRAR_PRG, otherwise an option byte change error is raised.

When this option bit is set, the content of the corresponding PCROP area is erased during a RDP level 1 to 0 regression (see Section 4.5.3 ) or a bank erase with protection removal (see Section 4.3.10 ). It is preserved otherwise.

There are no restrictions in setting DMEP bit. Resetting DMEP bit from 1 to 0 can only be done when an RDP level 1 to 0 regression or a bank erase with protection removal is requested at the same time.

The SECURITY option bit activates the secure access mode described in Section 4.5.5 . This option bit can be freely set by the application software if such mode is activated on the device. If at least one PCROP or secure-only area is defined as not null, the only way to deactivate the security option bit (from 1 to 0) is to perform an RDP level 1 to 0 regression, when DMEP is set to 1 in either FLASH_PRAR_CUR or FLASH_PRAR_PRG registers, and DMES is set to 1 in either FLASH_SCAR_CUR or FLASH_SCAR_PRG.

If no valid secure-only area and no valid PCROP area are currently defined, the SECURITY option bit can be freely reset.

Note: It is recommended to have both SEC_AREA_START > SEC_AREA_END and PROT_AREA_START > PROT_AREA_END programmed when deactivating the SECURITY option bit during an RDP level 1 to 0 regression.

These option bytes configure the size of the secure-only areas in FLASH_SCAR_CUR registers. They can be changed without any restriction by the user secure application or by the ST secure library running on the device. For user non-secure application, the secure-only area size can be removed by performing a bank erase with protection removal (see Section 4.3.10 ), or an RDP level 1 to 0 regression when DMES set to 1 in either FLASH_SCAR_CUR or FLASH_SCAR_PRG (otherwise an option byte change error is raised).

When this option bit is set, the content of the corresponding secure-only area is erased during an RDP level 1 to 0 regression or a bank erase with protection removal, it is preserved otherwise.

DMES bits can be set without any restriction. Resetting DMES bit from 1 to 0 can only be performed when an RDP level 1 to 0 regression or a bank erase with protection removal is requested at the same time.

These bits selects the size of the secure DTCM, an option that is available only when SECURITY option bit is set. It can be modified only when the CPU is running the ST secure library.

4.4.4 Option bytes overview

Table 18 lists all the user option bytes managed through the embedded Flash memory registers, as well as their default values before the first option byte change (default factory value).

Table 18. Option byte organization

RegisterBitfield
31302928272625242322212019181716
FLASH_OPTSR_x[31:16]Res.OPTCHANGERIO_HSLVRes.Res.Res.Res.Res.Res.Res.SECURITYST_RAM_SIZEIWDG_FZ_SDBYIWDG_FZ_STOPRes.
Default factory value0001011110011110
FLASH_OPTSR_x[15:0]1514131211109876543210
RDP[7:0]NRST_STDY_D1NRST_STOP_D1Res.IWDG1_SWBOR_LEVRes.Res.
Default factory value1010101011110000
FLASH_OPTSR2_x[15:0]1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CPUFREQ_BOOSTTOM_AXI_SHARED
Default factory value0000000000000000
FLASH_BOOT_x[31:16]31302928272625242322212019181716
BOOT_CM_ADD1[15:0]
Default factory value0x1FF0
FLASH_BOOT_x[15:0]1514131211109876543210
BOOT_CM_ADD0[15:0]
Default factory value0x0800
FLASH_PRAR_x[31:16]31302928272625242322212019181716
DMEPRes.Res.Res.PROT_AREA_END

Table 18. Option byte organization (continued)

RegisterBitfield
Default factory value0x000
FLASH_PRAR_x[15:0]1514131211109876543210
Res.Res.Res.Res.PROT_AREA_START
Default factory value0x0FF
FLASH_SCAR_x[31:16]31302928272625242322212019181716
DMESRes.Res.Res.SEC_AREA_END
Default factory value0x000
FLASH_SCAR_x[15:0]1514131211109876543210
Res.Res.Res.Res.SEC_AREA_START
Default factory value0x0FF
FLASH_WPSN_x[31:16]31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Default factory value0000000000000000
FLASH_WPSN_x[15:0]1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.WRPSn[7:0]
Default factory value0000000011111111

4.4.5 Description of user and system option bytes

Below the list of the general-purpose option bytes that can be used by the application:

Note: If the hardware watchdog “control selection” feature is enabled (set to 0), the watchdog is automatically enabled at power-on, thus generating a reset unless the watchdog key register is written to or the down-counter is reloaded before the end-of-count is reached. Depending on the configuration of IWDG_STOP and IWDG_STBY options, the IWDG can continue counting (1) or not (0) when the device is in Stop or Standby mode, respectively.

When the IWDG is kept running during Stop or Standby mode, it can wake up the device from these modes.

Note: Whenever a Standby (respectively Stop) mode entry sequence is successfully executed, the device is reset instead of entering Standby (respectively Stop) mode if NRST_STDBY (respectively NRST_STOP) is cleared to 0.

When STMicroelectronics delivers the device, the values programmed in the general-purpose option bytes are the following:

Refer to Section 4.9: FLASH registers for details.

4.4.6 Description of data protection option bytes

Below the list of the option bytes that can be used to enhance data protection:

When STMicroelectronics delivers the device, the values programmed in the data protection option bytes are the following:

Refer to Section 4.9: FLASH registers for details.

4.4.7 Description of boot address option bytes

Below the list of option bytes that can be used to configure the appropriate boot address for your application:

When STMicroelectronics delivers the device, the values programmed in the boot address option bytes are the following:

Refer to Section 4.9: FLASH registers for details.

4.5 FLASH protection mechanisms

Since sensitive information can be stored in the Flash memory, it is important to protect it against unwanted operations such as reading confidential areas, illegal programming of protected area, or illegal Flash memory erasing.

The embedded Flash memory implements the following protection mechanisms that can be used by end-user applications to manage the security of embedded non-volatile storage:

This section provides a detailed description of all these security mechanisms.

4.5.1 FLASH configuration protection

The embedded Flash memory uses hardware mechanisms to protect the following assets against unwanted or spurious modifications (e.g. software bugs):

More specifically, write operations to embedded Flash memory control registers (FLASH_CR and FLASH_OPTCR) are not allowed after reset.

The following sequence must be used to unlock FLASH_CR register:

  1. 1. Program KEY1 to 0x45670123 in FLASH_KEYR key register.
  2. 2. Program KEY2 to 0xCDEF89AB in FLASH_KEYR key register.
  3. 3. LOCK bit is now cleared and FLASH_CR is unlocked.

The following sequence must be used to unlock FLASH_OPTCR register:

  1. 1. Program OPTKEY1 to 0x08192A3B in FLASH_OPTKEYR option key register.
  2. 2. Program OPTKEY2 to 0x4C5D6E7F in FLASH_OPTKEYR option key register.
  3. 3. OPTLOCK bit is now cleared and FLASH_OPTCR register is unlocked.

Any wrong sequence locks up the corresponding register/bit until the next system reset, and generates a bus error.

The FLASH_CR (respectively FLASH_OPTCR) register can be locked again by software by setting the LOCK bit in FLASH_CR register (respectively OPTLOCK bit in FLASH_OPTCR register).

In addition the FLASH_CR register remains locked and a bus error is generated when the following operations are executed:

Similarly the FLASH_OPTCR register remains locked and a bus error is generated when the following operations are executed:

The embedded Flash memory configuration registers protection is summarized in Table 19 .

Table 19. Flash interface register protection summary

Register NameUnlocking registerProtected asset
FLASH_ACRN/A-
FLASH_KEYRN/A-
FLASH_OPTKEYRN/A-
FLASH_CRFLASH_KEYRWrite operations
Erase commands
Interrupt generation masking sources
FLASH_SRN/A-
FLASH_CCRN/A-
FLASH_OPTCRFLASH_OPTKEYROption bytes change
Mass erase
FLASH_OPTSR_PRG
FLASH_OPTSR2_PRG
FLASH_OPTCROption bytes change
FLASH_OPTCCRN/A-
FLASH_PRAR_PRGFLASH_OPTCROption bytes (PCROP)
FLASH_SCAR_PRGFLASH_OPTCROption bytes (security)
FLASH_WPSN_PRGFLASH_OPTCROption bytes (write protection)
FLASH_BOOT_PRGFLASH_OPTCROption bytes (boot)
FLASH_CRCRN/A-
FLASH_CRCSADDR-
FLASH_CRCEADDR-
FLASH_CRCDATAR-
FLASH_ECC_FARN/A-

4.5.2 Write protection

The purpose of embedded Flash memory write protection is to protect the embedded Flash memory against unwanted modifications of the non-volatile code and/or data.

Any 128-Kbyte Flash sector can be independently write-protected or unprotected by clearing/setting the corresponding WRPSn bit in the FLASH_WPSN_PRG register.

A write-protected sector can neither be erased nor programmed. As a result, a bank erase cannot be performed if one sector is write-protected, unless a bank erase with automatic

protection removal or an RDP level 1 to 0 regression is executed (see Section : Flash bank erase with automatic protection-removal sequence for details).

The embedded Flash memory write-protection user option bits can be modified without any restriction when the RDP level is set to level 0 or level 1. When it is set to level 2, the write protection bitfield can no more be changed in the option bytes.

Note: PCROP or secure-only areas are write and erase protected.

Write protection errors are documented in Section 4.7: FLASH error management .

4.5.3 Readout protection (RDP)

The embedded Flash memory readout protection is global as it does not apply only to the embedded Flash memory, but also to the other secured regions. This is done by using dedicated security signals.

In this section other secured regions are defined as:

The global readout protection level is set by writing the values given in Table 20 into the readout protection (RDP) option byte (see Section 4.4.3: Option byte modification ).

Table 20. RDP value vs readout protection level

RDP option byte valueGlobal Readout Protection Level
0xAALevel 0
0xCCLevel 2
Any other valueLevel 1 (1)

1. Default protection level when RDP option byte is erased.

Definitions of RDP global protection level

RDP Level 0 (no protection)

When the global read protection level 0 is set, all read/program/erase operations from/to the user Flash memory are allowed (if no others protections are set). This is true whatever the boot configuration (boot from user or system flash memory, boot from RAM), and whether the debugger is connected to the device or not. Accesses to the other secured regions are also allowed.

RDP Level 1 (Flash memory content protection)

When the global read protection level 1 is set, the below properties apply:

memory are allowed (if no other protections are set). Accesses to the other secured regions are also allowed.

RDP Level 2 (device protection and intrusion prevention)

When the global read protection level 2 is set, the below rules apply:

Caution: Memory read protection level 2 is an irreversible operation. When level 2 is activated, the level of protection cannot be changed back to level 0 or level 1.

Note: The JTAG port is permanently disabled when level 2 is active (acting as a JTAG fuse). As a consequence, STMicroelectronics is not able to perform analysis on defective parts on which the level 2 protection has been set.

Apply a power-on reset if the global read protection level 2 is set while the debugger is still connected.

The above RDP global protection is summarized in Table 21 .

Table 21. Protection vs RDP Level (1)

Boot areaInputsEffectsComment
RDPDebugger connectedUser Flash memory access (2)System Flash memory access (3)Other secured regionsOption Bytes access
User Flash memoryLevel 0Yes (4) /NoR/W/ERR/WR/W
Level 1Yes (3)illegal access (5)Rno accessR/W-
Level 1NoR/W/ERR/WR/W
Level 2NoR/W/ ERR/WR
Table 21. Protection vs RDP Level (1) (continued)
Boot areaInputsEffectsComment
RDPDebugger connectedUser Flash memory access (2)System Flash memory access (3)Other secured regionsOption Bytes access
RAM or System Flash memoryLevel 0Yes (3) /NoR/W/ERR/WR/W-
Level 1Yes (3) /Noillegal access (5)Rno accessR/WWhen selected, only ST basic bootloader is executed
Level 2NoNot applicableNo boot from RAM or ST system Flash memory in RDP level 2
  1. 1. R = read, W = write, E = erase.
  2. 2. PCROP (see Section 4.5.4 ) and secure-only access control (see Section 4.5.5 ) applies.
  3. 3. Read accesses to secure boot and secure libraries stored in system Flash possible only from STMicroelectronics code.
  4. 4. JTAG interface disabled while secure libraries are executed.
  5. 5. Read protection error (RDPERR) with bus error on read operations, Write protection error (WRPERR) on write/erase operations.

RDP protection transitions

Figure 12 shows how to switch from one RDP level to another. The transition is effective after successfully writing the option bytes including RDP (refer to Section 4.4.3 for details on how to change the option bytes).

Figure 12. RDP protection transition scheme

Figure 12. RDP protection transition scheme diagram showing transitions between RDP Level 0, 1, and 2.

The diagram illustrates the RDP protection transition scheme between three levels: RDP Level 0 (full debug, no intrusion), RDP Level 1 (full debug, intrusion detection), and RDP Level 2 (no debug). Transitions are indicated by arrows:

A legend at the bottom left explains the arrow types. The diagram code is MSv63827V1.

Figure 12. RDP protection transition scheme diagram showing transitions between RDP Level 0, 1, and 2.

Table 22 details the RDP transitions and their effects on the product.

Table 22. RDP transition and effects

RDP transitionRDP option updateEffect on device
Level before changeLevel after changeDebugger disconnectOption bytes changeMass erase
L0L1not 0xAA and not 0xCCNoAllowedNo
L20xCCYesNot allowedNo
L1L20xCCYesNot allowedNo
L00xAANoAllowedYes
L0L00xAANoAllowedNo
L1L1not 0xAA and not 0xCC

When the current RDP level is RDP level 1, requesting a new RDP level 0 causes a full mass erase:

Note: Data in write protection area are not preserved during RDP regression.

During a level regression, if a PCROP area overlaps with a secure-only area, the embedded Flash memory performs the erase operation depending on the DMES/DMEP options bits (see strike-through areas in red in Figure 13). More specifically:

Note: The sector protections (PCROP, secure-only) are removed only if the protected sector boundaries are modified by the user application.

Figure 13. Example of protected region overlapping

Figure 13: Example of protected region overlapping. The diagram shows two memory sector configurations. The left configuration has DMEP=1 and DMES=0, with SEC_AREA_START at Sector 4 and SEC_AREA_END at Sector 7. A protected region is defined with PROT_AREA_START at Sector 3 and PROT_AREA_END at Sector 5. Sectors 4 and 5 are highlighted in green (PCROP), while Sectors 3 and 6 are highlighted in pink (SEC). The right configuration has DMEP=0 and DMES=1, with the same SEC_AREA_START and SEC_AREA_END. The protected region is defined with PROT_AREA_START at Sector 3 and PROT_AREA_END at Sector 4. Sectors 3 and 4 are highlighted in green (PCROP), while Sectors 5 and 6 are highlighted in pink (SEC). A legend indicates that pink represents 'secure access only (SEC)' and green represents 'execute only, no data access (PCROP)'. The diagram is labeled MSv63828V1.
Figure 13: Example of protected region overlapping. The diagram shows two memory sector configurations. The left configuration has DMEP=1 and DMES=0, with SEC_AREA_START at Sector 4 and SEC_AREA_END at Sector 7. A protected region is defined with PROT_AREA_START at Sector 3 and PROT_AREA_END at Sector 5. Sectors 4 and 5 are highlighted in green (PCROP), while Sectors 3 and 6 are highlighted in pink (SEC). The right configuration has DMEP=0 and DMES=1, with the same SEC_AREA_START and SEC_AREA_END. The protected region is defined with PROT_AREA_START at Sector 3 and PROT_AREA_END at Sector 4. Sectors 3 and 4 are highlighted in green (PCROP), while Sectors 5 and 6 are highlighted in pink (SEC). A legend indicates that pink represents 'secure access only (SEC)' and green represents 'execute only, no data access (PCROP)'. The diagram is labeled MSv63828V1.

About RDP protection errors

Whatever the RDP level, the corresponding error flag is raised when an illegal read or write access is detected (see Section 4.7: FLASH error management ).

4.5.4 Proprietary code readout protection (PCROP)

The embedded Flash memory allows the definition of an “executable-only” area in the user area. In this area, only instruction fetch transactions from the system, i.e. no data access (data or literal pool) are allowed. This protection is particularly efficient to protect third party software intellectual property.

Note: Executable-only area usage requires the native code to be compiled accordingly using “execute-only” option.

PCROP area programming

One PCROP area can be defined by setting the PROT_AREA_END and PROT_AREA_START option bytes so that the END address is strictly higher than the START address. PROT_AREA_START and PROT_AREA_END are defined with a granularity of 256 bytes. This means that the actual PCROP area size (in bytes) is defined by:

\[ [(\text{PROT\_AREA\_END} - \text{PROT\_AREA\_START}) + 1] \times 256 \]

As an example, to set a PCROP area on the first 4 Kbytes (i.e. from address 0x0800 0000 to address 0x0800 0FFF, both included), the embedded Flash memory must be configured as follows:

The protected area size defined above is equal to:

\[ [(\text{PROT\_AREA\_END} - \text{PROT\_AREA\_START}) + 1] \times 256 = 16 \times 256 \text{ bytes} = 4 \text{ Kbytes.} \]

The minimum execute-only PCROP area that can be set is 16 Flash words (or 512 bytes). The maximum area is the whole user Flash memory, configured by setting to the same value the PCROP area START and END addresses.

Note: It is recommended to align the PCROP area size with the Flash sector granularity in order to avoid access right issues.

PCROP area properties

Each valid PCROP area has the following properties:

For more information on PCROP protection errors, refer to Section 4.7: FLASH error management .

4.5.5 Secure access mode

The embedded Flash memory allows the definition of a secure-only area in the user area. This area can be accessed only while the CPU executes secure application code. This feature is available only if the SECURITY option bit is set to 1.

Secure-only areas help isolating secure user code from application non-secure code. As an example, they can be used to protect a customer secure firmware upgrade code, a custom secure boot library or a third party secure library.

Secure-only area programming

One secure-only area can be defined by setting the SEC_AREA_END and SEC_AREA_START option bytes so that the END address is strictly higher than the START address. SEC_AREA_START and SEC_AREA_END are defined with a granularity of 256 bytes. This means that the actual secure-only area size (in bytes) is defined by:

\[ [(SEC\_AREA\_END - SEC\_AREA\_START) + 1] \times 256 \]

As an example, to set a secure-only area on the first 8 Kbytes (i.e. from address 0x0800 0000 to address 0x0800 1FFF, both included), the embedded Flash memory must be configured as follows:

The secure-only area size defined above is equal to:

\[ [(SEC\_AREA\_END - SEC\_AREA\_START) + 1] \times 256 = 32 \times 256 \text{ bytes} = 8 \text{ Kbytes.} \]

Note: These option bytes can be modified only by the CPU running ST security library or application secure code, except during regression level or erase with protection removal.

The minimum secure-only area that can be set is 16 Flash words (or 512 bytes). The maximum area is the whole user Flash memory bank, configured by setting to the same value the secure-only area START and END addresses.

Note: It is recommended to align the secure-only area size with Flash sector granularity in order to avoid access right issues.

Secure-only access area properties

For more information on secure-only protection errors, refer to Section 4.7: FLASH error management .

4.6 FLASH low-power modes

4.6.1 Introduction

The table below summarizes the behavior of the embedded Flash memory in the microcontroller low-power modes. The embedded Flash memory belongs to the D1 domain.

Table 23. Effect of low-power modes on the embedded Flash memory

System statePower modeD1 domain voltage rangeAllowed if FLASH busyFLASH power mode (in D1 domain)
D1 domainD2 domain
RunDRunDRun, DStop or DStandbyVOS0/1/2/3YesRun
DStopDStop or DStandbyVOS0/1/2/3NoOff
DStandbyDStop or DStandbyOffNoOff
StopDStopDStop or DStandbySVOS3/4/5NoClock gated or Stopped
DStandbyDStop or DStandbyOffNoOff
Standby (1)DStandbyDStandbyNo
  1. 1. D3 domain must always be in DStandby mode. When all clocks are stopped and the CPU is in CStop, the VCORE domain is switched off.

When the system state changes or within a given system state, the embedded Flash memory might get a different voltage supply range (VOS) according to the application. The procedure to switch the embedded Flash memory into various power mode (run, clock gated, stopped, off) is described hereafter.

Note: For more information in the microcontroller power states, refer to the Power control section (PWR).

4.6.2 Managing the FLASH domain switching to DStop or DStandby

As explain in Table 23 , if the embedded Flash memory informs the reset and clock controller (RCC) that it is busy (i.e. BSY, QW, WBNE is set), the microcontroller cannot switch the D1 domain to DStop or DStandby mode.

Note: CRC_BUSY is not taken into account.

There are two ways to release the embedded Flash memory:

The microcontroller can then switch the domain to DStop or DStandby mode.

4.7 FLASH error management

4.7.1 Introduction

The embedded Flash memory automatically reports when an error occurs during a read, program or erase operation. A wide range of errors are reported:

The application software can individually enable the interrupt for each error, as detailed in Section 4.8: FLASH interrupts .

Note: For some errors, the application software must clear the error flag before attempting a new operation.

4.7.2 Write protection error (WRPERR)

When an illegal erase/program operation is attempted to the non-volatile memory bank, the embedded Flash memory sets the write protection error flag WRPERR in FLASH_SR register.

An erase operation is rejected and flagged as illegal if it targets one of the following memory areas:

An program operation is ignored and flagged as illegal if it targets one of the following memory areas:

When WRPERR flag is raised, the operation is rejected and nothing is changed in the bank. If a write burst operation was ongoing, WRPERR is raised each time a Flash word write operation is processed by the embedded Flash memory.

Note: WRPERR flag does not block any new erase/program operation.

Not resetting the write protection error flag (WRPERR) does not generate a PGSERR error.

WRPERR flag is cleared by setting CLR_WRPERR bit to 1 in FLASH_CCR register.

If WRPERRIE bit in FLASH_CR register is set to 1, an interrupt is generated when WRPERR flag is raised (see Section 4.8: FLASH interrupts for details).

4.7.3 Programming sequence error (PGSERR)

When the programming sequence is incorrect, the embedded Flash memory sets the programming sequence error flag PGSERR in FLASH_SR register.

More specifically, PGSERR flag is set if one of below conditions is met:

When PGSERR flag is raised, the current program operation is aborted and nothing is changed. The write data buffer is also flushed. If a write burst operation was ongoing, PGSERR is raised at the end of the burst.

Note: When PGSERR flag is raised, there is a risk that the last write operation performed by the application has been lost because of the above protection mechanism. Hence it is recommended to generate interrupts on PGSERR and verify in the interrupt handler if the last write operation has been successful by reading back the value in the Flash memory.

The PGSERR flag also blocks any new program operation. This means that PGSERR must be cleared before starting a new program operation.

PGSERR flag is cleared by setting CLR_PGSERR bit to 1 in FLASH_CCR register.

If PGSERRIE bit in FLASH_CR register is set to 1, an interrupt is generated when PGSERR flag is raised. See Section 4.8: FLASH interrupts for details.

4.7.4 Strobe error (STRBERR)

When the application software writes several times to the same byte write buffer, the embedded Flash memory sets the strobe error flag STRBERR in FLASH_SR register.

When STRBERR flag is raised, the current program operation is not aborted. The application can ignore the error, proceed with the current write operation and request new write operations. If a write burst was ongoing, STRBERR is raised at the end of the burst.

STRBERR flag is cleared by setting CLR_STRBERR bit to 1 in FLASH_CCR register.

If STRBERRIE bit in FLASH_CR register is set to 1, an interrupt is generated when STRBERR flag is raised. See Section 4.8: FLASH interrupts for details.

4.7.5 Inconsistency error (INCERR)

When a programming inconsistency is detected, the embedded Flash memory sets the inconsistency error flag INCERR in register FLASH_SR.

More specifically, INCERR flag is set when one of the following conditions is met:

Note: INCERR flag must be cleared before starting a new write operation, otherwise a sequence error (PGSERR) is raised.

It is recommended to follow the sequence below to avoid losing data when an inconsistency error occurs:

  1. 1. Execute a handler routine when INCERR flag is raised.
  2. 2. Stop all write requests to embedded Flash memory.
  3. 3. Verify that the write operations that have been requested just before the INCERR event have been successful by reading back the programmed values from the memory.
  4. 4. Clear the corresponding INCERR bit.
  5. 5. Restart the write operations where they have been interrupted.

INCERR flag is cleared by setting CLR_INCERR bit to 1 in FLASH_CCR register.

If INCERRIE bit in FLASH_CR register is set to 1, an interrupt is generated when INCERR flag is raised (see Section 4.8: FLASH interrupts for details).

4.7.6 Operation error (OPERR)

When an error occurred during a write or an erase operation, the embedded Flash memory sets the operation error flag OPERR in FLASH_SR register. This error may be caused by an incorrect non-volatile memory behavior due to cycling issues or to a previous modify operation stopped by a system reset.

When OPERR flag is raised, the current program/erase operation is aborted.

OPERR flag is cleared by setting CLR_OPERR bit to 1 in FLASH_CCR register.

If OPERRIE bit in FLASH_CR register is set to 1, an interrupt is generated when OPERR flag is raised (see Section 4.8: FLASH interrupts for details).

4.7.7 Error correction code error (SNECCERR/DBECCERR)

When a single error correction is detected during a read the embedded Flash memory sets the single error correction flag SNECCERR in FLASH_SR register.

When two ECC errors are detected during a read, the embedded Flash memory sets the double error detection flag DBECCERR in FLASH_SR register. When SNECCERR flag is raised, the corrected read data are returned. Hence the application can ignore the error and request new read operations.

If a read burst operation was ongoing, SNECCERR or DBECCERR flag is raised each time a new data is sent back to the requester through the AXI interface.

When SNECCERR or DBECCERR flag is raised, the address of the Flash word that generated the error is saved in the FLASH_ECC_FAR register. This register is automatically cleared when the associated flag that generated the error is reset.

Note: In case of successive single correction or double detection errors, only the address corresponding to the first error is stored in FLASH_ECC_FAR register.

When DBECCERR flag is raised, a bus error is generated. In case of successive double error detections, a bus error is generated each time a new data is sent back to the requester through the AXI interface.

Note: It is not mandatory to clear SNECCERR or DBECCERR flags before starting a new read operation.

SNECCERR (respectively DBECCERR) flag is cleared by setting to 1 CLR_SNECCERR bit in FLASH_CCR register.

If SNECCERR (respectively DBECCERR) bit in FLASH_CR register is set to 1, an interrupt is generated when SNECCERR (respectively DBECCERR) flag is raised. See Section 4.8: FLASH interrupts for details.

4.7.8 Read protection error (RDPERR)

When a read operation to a PCROP, a secure-only or a RDP protected area is attempted in non-volatile memory bank, the embedded Flash memory sets the read protection error flag RDPERR in FLASH_SR register.

When RDPERR flag is raised, the current read operation is aborted but the application can request new read operations. If a read burst was ongoing, RDPERR is raised each time a data is sent back to the requester through the AXI interface.

Note: A bus error is raised if a standard application attempts to execute on a secure-only or a RDP protected area.

RDPERR flag is cleared by setting CLR_RDPERR bit to 1 in FLASH_CCR register.

If RDPERRIE bit in FLASH_CR register is set to 1, an interrupt is generated when RDPERR flag is raised (see Section 4.8: FLASH interrupts for details).

4.7.9 Read secure error (RDSERR)

When a read operation is attempted to a secure address, the embedded Flash memory sets the read secure error flag RDSERR in FLASH_SR register. For more information, refer to Section 4.5.5: Secure access mode .

When RDSERR flag is raised, the current read operation is aborted and the application can request new read operations. If a read burst was ongoing, RDSERR is raised each time a data is sent back to the requester through the AXI interface.

Note: The bus error is raised only if the illegal access is due to an instruction fetch.

RDSERR flag is cleared by setting CLR_RDSERR bit to 1 in FLASH_CCR register.

If RDSERRIE bit in FLASH_CR register is set to 1, an interrupt is generated when RDSERR flag is raised (see Section 4.8: FLASH interrupts for details).

4.7.10 CRC read error (CRCRDERR)

After a CRC computation, the embedded Flash memory sets the CRC read error flag CRCRDERR in FLASH_SR register when one or more address belonging to a protected area was read by the CRC module. A protected area corresponds to a PCROP area (see Section 4.5.4 ) or to a secure-only area (see Section 4.5.5 ).

CRCRDERR flag is raised when CRCEND bit is set to 1 (end of CRC calculation). In this case, it is likely that the CRC result is wrong since illegal read operations to protected areas return null values.

CRCRDERR flag is cleared by setting CLR_CRCRDERR bit to 1 in FLASH_CCR register.

If CRCRDERRIE bit in FLASH_CR register is set to 1, an interrupt is generated when CRCRDERR flag is raised together with CRCEND bit (see Section 4.8: FLASH interrupts for details).

4.7.11 Option byte change error (OPTCHANGEERR)

When the embedded Flash memory finds an error during an option change operation, it aborts the operation and sets the option byte change error flag OPTCHANGEERR in FLASH_OPTSR_CUR register.

OPTCHANGEERR flag is cleared by setting CLR_OPTCHANGEERR bit to 1 in FLASH_OPTCCR register.

If OPTCHANGEERRIE bit in FLASH_OPTCR register is set to 1, an interrupt is generated when OPTCHANGEERR flag is raised (see Section 4.8: FLASH interrupts for details).

4.7.12 Miscellaneous HardFault errors

The following events generate a bus error on the corresponding bus interface:

4.8 FLASH interrupts

The embedded Flash memory can generate a maskable interrupt to signal the following events:

These multiple sources are combined into a single interrupt signal, flash_it , which is the only interrupt signal from the embedded Flash memory that drives the NVIC (nested vectored interrupt controller).

You can individually enable or disable embedded Flash memory interrupt sources by changing the mask bits in the FLASH_CR register. Setting the appropriate mask bit to 1 enables the interrupt.

Note: Prior to writing, FLASH_CR register must be unlocked as explained in Section 4.5.1: FLASH configuration protection

Table 24 gives a summary of the available embedded Flash memory interrupt features. As mentioned in the table below, some flags need to be cleared before a new operation is triggered.

Table 24. Flash interrupt request

Interrupt eventEvent flagEnable control bitClear flag to resume operationBus error
End-of-program eventEOPEOPIEN/AN/A
CRC complete eventCRCENDCRCENDIEN/AN/A
Write protection errorWRPERRWRPERRIENoNo
Programming sequence errorPGSERRPGSERRIEYes (1)No
Strobe errorSTRBERRSTRBERRIENoNo
Inconsistency errorINCERRINCERRIEYes (1)No
Operation errorOPERROPERRIENoNo

Table 24. Flash interrupt request (continued)

Interrupt eventEvent flagEnable control bitClear flag to resume operationBus error
ECC single error correction eventSNECCERRSNECCERRIENoNo
ECC double error detection eventDBECCERRDBECCERRIENoYes
Read protection errorRDPERRRDPERRIENoYes (2)
Read secure errorRDSERRRDSERRIENoNo
(data)
Yes
(fetch)
CRC read errorCRCRDERRCRCRDERRIENoNo
Option Bytes operation errorOPTCHANGEERROPTCHANGEERRIENoNo
  1. 1. Programming still possible on the AXI interface that did not trigger the inconsistency error, on the Flash bank that does not have the flag bit raised. See Section 4.7.5: Inconsistency error (INCERR) for details.
  2. 2. Bus error occurs only when accessing RDP protected area, as defined in Section 4.5.3: Readout protection (RDP)

The status of the individual maskable interrupt sources described in Table 24 (except for option byte error) can be read from the FLASH_SR register. They can be cleared by setting to 1 the adequate bit in FLASH_CCR register.

Note: No unlocking mechanism is required to clear an interrupt.

End-of-program event

Setting the end-of-operation interrupt enable bit (EOPIE) in the FLASH_CR register enables the generation of an interrupt at the end of an erase operation, a program operation or an option byte change. The EOP bit in the FLASH_SR register is also set when one of these events occurs.

Setting CLR_EOP bit to 1 in FLASH_CCR register clears EOP flag.

CRC end of calculation event

Setting the CRC end-of-calculation interrupt enable bit (CRCENDIE) in the FLASH_CR register enables the generation of an interrupt at the end of a CRC operation. The CRCEND bit in the FLASH_SR register is also set when this event occurs.

Setting CLR_CRCEND bit to 1 in FLASH_CCR register clears CRCEND flag.

4.9 FLASH registers

4.9.1 FLASH access control register (FLASH_ACR)

Address offset: 0x000

Reset value: 0x0000 0037

For more details, refer to Section 4.3.8: FLASH read operations and Section 4.3.9: FLASH program operations .

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.WRHIGHFREQ
[1:0]
LATENCY[3:0]
rwrwrwrwrwrw

Bits 31:6 Reserved, must be kept at reset value.

Bits 5:4 WRHIGHFREQ[1:0] : Flash signal delay

These bits are used to control the delay between non-volatile memory signals during programming operations. The application software has to program them to the correct value depending on the embedded Flash memory interface frequency. Please refer to Table 16 for details.

Note: No check is performed by hardware to verify that the configuration is correct.

Bits 3:0 LATENCY[3:0] : Read latency

These bits are used to control the number of wait states used during read operations. The application software has to program them to the correct value depending on the embedded Flash memory interface frequency and voltage conditions.

0000: zero wait state used to read a word from non-volatile memory

0001: one wait state used to read a word from non-volatile memory

0010: two wait states used to read a word from non-volatile memory

...

1111: 15 wait states used to read from non-volatile memory

Note: No check is performed by hardware to verify that the configuration is correct.

4.9.2 FLASH key register (FLASH_KEYR)

Address offset: 0x004

Reset value: 0x0000 0000

FLASH_KEYR is a write-only register. The following values must be programmed consecutively to unlock FLASH_CR register:

  1. 1 st key = 0x4567 0123
  2. 2 nd key = 0xCDEF 89AB
31302928272625242322212019181716
KEY[31:16]
wwwwwwwwwwwwwwww
1514131211109876543210
KEY[15:0]
wwwwwwwwwwwwwwww

Bits 31:0 KEY[31:0] : Non-volatile memory bank configuration access unlock key

4.9.3 FLASH option key register (FLASH_OPTKEYR)

Address offset: 0x008

Reset value: 0x0000 0000

FLASH_OPTKEYR is a write-only register. The following values must be programmed consecutively to unlock FLASH_OPTCR register:

  1. 1 st key = 0x0819 2A3B
  2. 2 nd key = 0x4C5D 6E7F
31302928272625242322212019181716
OPTKEY[31:16]
wwwwwwwwwwwwwwww
1514131211109876543210
OPTKEY[15:0]
wwwwwwwwwwwwwwww

Bits 31:0 OPTKEY[31:0] : FLASH option bytes control access unlock key

4.9.4 FLASH control register (FLASH_CR)

Address offset: 0x00C

Reset value: 0x0000 0031

31302928272625242322212019181716
Res.Res.Res.CRCRDERRIECRCENDIEDBECERRIESNECCERRIERDSERRIERDPERRIEOPERIEINCERRIERes.STRBERRIEPGSERRIEWRPERRIEEOPIE
rwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
CRC_ENRes.Res.Res.Res.SNB[2:0]STARTFWPSIZE[1:0]BERSERPGLOCK
rwrwrwrwrwrwrwrwrwrwrwrs

Bits 31:29 Reserved, must be kept at reset value.

Bit 28 CRCRDERRIE : CRC read error interrupt enable bit

When CRCRDERRIE bit is set to 1, an interrupt is generated when a protected area (PCROP or secure-only) has been detected during the last CRC computation. CRCRDERRIE can be programmed only when LOCK1 is set to 0.

0: no interrupt generated when a CRC read error occurs

1: interrupt generated when a CRC read error occurs

Bit 27 CRCENDIE : CRC end of calculation interrupt enable bit

When CRCENDIE bit is set to 1, an interrupt is generated when the CRC computation has completed. CRCENDIE can be programmed only when LOCK1 is set to 0.

0: no interrupt generated when CRC computation complete

1: interrupt generated when CRC computation complete

Bit 26 DBECERRIE : ECC double detection error interrupt enable bit

When DBECERRIE bit is set to 1, an interrupt is generated when an ECC double detection error occurs during a read operation. DBECERRIE can be programmed only when LOCK1 is set to 0.

0: no interrupt generated when an ECC double detection error occurs

1: interrupt generated if an ECC double detection error occurs

Bit 25 SNECERRIE : ECC single correction error interrupt enable bit

When SNECERRIE bit is set to 1, an interrupt is generated when an ECC single correction error occurs during a read operation. SNECERRIE can be programmed only when LOCK1 is set to 0.

0: no interrupt generated when an ECC single correction error occurs

1: interrupt generated when an ECC single correction error occurs

Bit 24 RDSERRIE : Secure error interrupt enable bit

When RDSERRIE bit is set to 1, an interrupt is generated when a secure error (access to a secure-only protected address) occurs during a read operation. RDSERRIE can be programmed only when LOCK1 is set to 0.

0: no interrupt generated when a secure error occurs

1: an interrupt is generated when a secure error occurs

Bit 23 RDPERRIE : Read protection error interrupt enable bit

When RDPERRIE bit is set to 1, an interrupt is generated when a read protection error occurs (access to an address protected by PCROP or by RDP level 1) during a read operation. RDPERRIE can be programmed only when LOCK1 is set to 0.

0: no interrupt generated when a read protection error occurs

1: an interrupt is generated when a read protection error occurs

Bit 22 OPERRIE : Write/erase error interrupt enable bit

When OPERRIE bit is set to 1, an interrupt is generated when an error is detected during a write/erase operation. OPERRIE can be programmed only when LOCK1 is set to 0.

0: no interrupt generated when a write/erase error occurs

1: interrupt generated when a write/erase error occurs

Bit 21 INCERRIE : Inconsistency error interrupt enable bit

When INCERRIE bit is set to 1, an interrupt is generated when an inconsistency error occurs during a write operation. INCERRIE can be programmed only when LOCK1 is set to 0.

0: no interrupt generated when an inconsistency error occurs

1: interrupt generated when an inconsistency error occurs.

Bit 20 Reserved, must be kept at reset value.

Bit 19 STRBERRIE: Strobe error interrupt enable bit

When STRBERRIE bit is set to 1, an interrupt is generated when a strobe error occurs (the master programs several times the same byte in the write buffer) during a write operation. STRBERRIE can be programmed only when LOCK1 is set to 0.

0: no interrupt generated when a strobe error occurs

1: interrupt generated when strobe error occurs.

Bit 18 PGSERRIE: Programming sequence error interrupt enable bit

When PGSERRIE bit is set to 1, an interrupt is generated when a sequence error occurs during a program operation. PGSERRIE can be programmed only when LOCK1 is set to 0.

0: no interrupt generated when a sequence error occurs

1: interrupt generated when sequence error occurs.

Bit 17 WRPERRIE: Write protection error interrupt enable bit

When WRPERRIE bit is set to 1, an interrupt is generated when a protection error occurs during a program operation. WRPERRIE can be programmed only when LOCK1 is set to 0.

0: no interrupt generated when a protection error occurs

1: interrupt generated when a protection error occurs.

Bit 16 EOPIE: End-of-program interrupt control bit

Setting EOPIE bit to 1 enables the generation of an interrupt at the end of a program operation. EOPIE can be programmed only when LOCK1 is set to 0.

0: no interrupt generated at the end of a program operation.

1: interrupt enabled when at the end of a program operation.

Bit 15 CRC_EN: CRC control bit

Setting CRC_EN bit to 1 enables the CRC calculation. CRC_EN does not start CRC calculation but enables CRC configuration through FLASH_CRCCR register.

When CRC calculation is performed, it can only be disabled by setting CRC_EN bit to 0.

Resetting CRC_EN clears CRC configuration and resets the content of FLASH_CRCDATAR register.

Clearing CRC_EN to 0 sets CRCDATA to 0x0.

CRC_EN can be programmed only when LOCK1 is set to 0.

Bits 14:11 Reserved, must be kept at reset value.

Bits 10:8 SNB[2:0]: Sector erase selection number

These bits are used to select the target sector for a sector erase operation (they are unused otherwise). SNB can be programmed only when LOCK is set to 0.

000: sector 0

001: sector 1

...

111: sector 7

Bit 7 START: Erase start control bit

START bit is used to start a sector erase or a bank erase operation. START can be programmed only when LOCK is set to 0.

The embedded Flash memory resets START when the corresponding operation has been acknowledged. The user application cannot access any embedded Flash memory register until the operation is acknowledged.

Bit 6 FW: Write forcing control bit

FW forces a write operation even if the write buffer is not full. In this case all bits not written are set to 1 by hardware. FW can be programmed only when LOCK is set to 0.

The embedded Flash memory resets FW when the corresponding operation has been acknowledged. The user application cannot access any embedded Flash memory register until the operation is acknowledged.

Note: Using a force-write operation prevents the application from updating later the missing bits with something else than 1, because it is likely that it will lead to permanent ECC error.

Write forcing is effective only if the write buffer is not empty (in particular, FW does not start several write operations when the force-write operations are performed consecutively).

Bits 5:4 PSIZE[1:0]: program size

PSIZE selects the parallelism used by the non-volatile memory during write and erase operations. PSIZE can be programmed only when LOCK is set to 0.

00: programming executed with byte parallelism

01: programming executed with half-word parallelism

10: programming executed with word parallelism

11: programming executed with double word parallelism

Bit 3 BER: erase request

Setting BER bit to 1 requests a bank erase operation (user Flash memory only). BER can be programmed only when LOCK is set to 0.

BER has a higher priority than SER: if both are set, the embedded Flash memory executes a bank erase.

0: bank erase not requested

1: bank erase requested

Note: Write protection error is triggered when a bank erase is required and some sectors are protected.

Bit 2 SER: sector erase request

Setting SER bit to 1 requests a sector erase. SER can be programmed only when LOCK is set to 0.

BER has a higher priority than SER: if both bits are set, the embedded Flash memory executes a bank erase.

0: sector erase not requested

1: sector erase requested

Note: Write protection error is triggered when a sector erase is required on protected sector(s).

Bit 1 PG: internal buffer control bit

Setting PG bit to 1 enables internal buffer for write operations. This allows preparing program operations even if a sector or bank erase is ongoing.

PG can be programmed only when LOCK is set to 0. When PG is reset, the internal buffer is disabled for write operations, and all the data stored in the buffer but not sent to the operation queue are lost.

Bit 0 LOCK: configuration lock bit

This bit locks the FLASH_CR register. The correct write sequence to FLASH_KEYR register unlocks this bit. If a wrong sequence is executed, or if the unlock sequence to FLASH_KEYR is performed twice, this bit remains locked until the next system reset.

LOCK can be set by programming it to 1. When set to 1, a new unlock sequence is mandatory to unlock it. When LOCK changes from 0 to 1, the other bits of FLASH_CR register do not change.

0: FLASH_CR register unlocked

1: FLASH_CR register locked

4.9.5 FLASH status register (FLASH_SR)

Address offset: 0x010

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.CRCRDERRCRCENDDBECCERRSNECCERRRDERRRDERROPERRINCERRRes.STRBERRPGSERRWRPERREOP
rrrrrrrrrrrr
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CRC_BUS
Y
QWWBNEBSY
rrrr

Bits 31:29 Reserved, must be kept at reset value.

Bit 28 CRCRDERR : CRC read error flag

CRCRDERR flag is raised when a word is found read protected during a CRC operation. An interrupt is generated if CRCRDIE and CRCEND are set to 1. Writing 1 to CLR_CRCRDERR bit in FLASH_CCR register clears CRCRDERR.

0: no protected area detected inside address read by CRC

1: a protected area has been detected inside address read by CRC. CRC result is very likely incorrect.

Note: This flag is valid only when CRCEND bit is set to 1

Bit 27 CRCEND : CRC end of calculation flag

CRCEND bit is raised when the CRC computation has completed. An interrupt is generated if CRCENDIE is set to 1. It is not necessary to reset CRCEND before restarting CRC computation. Writing 1 to CLR_CRCEND bit in FLASH_CCR register clears CRCEND.

0: CRC computation not complete

1: CRC computation complete

Bit 26 DBECCERR : ECC double detection error flag

DBECCERR flag is raised when an ECC double detection error occurs during a read operation. An interrupt is generated if DBECCERRIE is set to 1. Writing 1 to CLR_DBECCERR bit in FLASH_CCR register clears DBECCERR.

0: no ECC double detection error occurred

1: ECC double detection error occurred

Bit 25 SNECCERR : Single correction error flag

SNECCERR flag is raised when an ECC single correction error occurs during a read operation. An interrupt is generated if SNECCERRIE is set to 1. Writing 1 to CLR_SNECCERR bit in FLASH_CCR register clears SNECCERR.

0: no ECC single correction error occurs

1: ECC single correction error occurs

Bit 24 RDSERR : Secure error flag

RDSERR flag is raised when a read secure error (read access to a secure-only protected word) occurs. An interrupt is generated if RDSERRIE is set to 1. Writing 1 to CLR_RDSERR bit in FLASH_CCR register clears RDSERR.

0: no secure error occurs

1: a secure error occurs

Bit 23 RDPERR : Read Protection error flag

RDPERR flag is raised when an read protection error (read access to a PCROP-protected or a RDP-protected area) occurs. An interrupt is generated if RDPERRIE is set to 1. Writing 1 to CLR_RDPERR bit in FLASH_CCR register clears RDPERR.

0: no read protection error occurs

1: a read protection error occurs

Bit 22 OPERR : Write/erase error flag

OPERR flag is raised when an error occurs during a write/erase. An interrupt is generated if OPERRIE is set to 1. Writing 1 to CLR_OPERR bit in FLASH_CCR register clears OPERR.

0: no write/erase error occurs

1: a write/erase error occurs

Bit 21 INCERR : Inconsistency error flag

INCERR flag is raised when a inconsistency error occurs. An interrupt is generated if INCERRIE is set to 1. Writing 1 to CLR_INCERR bit in the FLASH_CCR register clears INCERR.

0: no inconsistency error occurs

1: a inconsistency error occurs

Bit 20 Reserved, must be kept at reset value.

Bit 19 STRBERR : Strobe error flag

STRBERR flag is raised when a strobe error occurs (when the master attempts to write several times the same byte in the write buffer). An interrupt is generated if the STRBERRIE bit is set to 1. Writing 1 to CLR_STRBERR bit in FLASH_CCR register clears STRBERR.

0: no strobe error occurs

1: a strobe error occurs

Bit 18 PGSERR : Programming sequence error flag

PGSERR flag is raised when a sequence error occurs. An interrupt is generated if the PGSERRIE bit is set to 1. Writing 1 to CLR_PGSERR bit in FLASH_CCR register clears PGSERR.

0: no sequence error occurs

1: a sequence error occurs

Bit 17 WRPERR : Write protection error flag

WRPERR flag is raised when a protection error occurs during a program operation. An interrupt is also generated if the WRPERRIE is set to 1. Writing 1 to CLR_WRPERR bit in FLASH_CCR register clears WRPERR.

0: no write protection error occurs

1: a write protection error occurs

Bit 16 EOP : End-of-program flag

EOP flag is set when a programming operation completes. An interrupt is generated if the EOPIE is set to 1. It is not necessary to reset EOP before starting a new operation. EOP bit is cleared by writing 1 to CLR_EOP bit in FLASH_CCR register.

0: no programming operation completed

1: a programming operation completed

Bits 15:4 Reserved, must be kept at reset value.

Bit 3 CRC_BUSY : CRC busy flag

CRC_BUSY flag is set when a CRC calculation is ongoing. This bit cannot be forced to 0. The user must wait until the CRC calculation has completed or disable CRC computation.

0: no CRC calculation ongoing

1: CRC calculation ongoing

Bit 2 QW : Wait queue flag

QW flag is set when a write, erase or option byte change operation is pending in the command queue buffer. It is not possible to know what type of programming operation is present in the queue.

This flag is reset by hardware when all write, erase or option byte change operations have been executed and thus removed from the waiting queue(s). This bit cannot be forced to 0. It is reset after a deterministic time if no other operations are requested.

0: no write, erase or option byte change operations waiting in the operation queues

1: at least one write, erase or option byte change operation is waiting in the operation queue

Bit 1 WBNE : Write buffer not empty flag

WBNE flag is set when the embedded Flash memory is waiting for new data to complete the write buffer. In this state, the write buffer is not empty. WBNE is reset by hardware each time the write buffer is complete or the write buffer is emptied following one of the event below:

This bit cannot be forced to 0. To reset it, clear the write buffer by performing any of the above listed actions, or send the missing data.

0: write buffer empty or full

1: write buffer waiting data to complete

Bit 0 BSY : Busy flag

BSY flag is set when an effective write, erase or option byte change operation is ongoing. It is not possible to know what type of operation is being executed.

BSY cannot be forced to 0. It is automatically reset by hardware every time a step in a write, erase or option byte change operation completes.

0: no programming, erase or option byte change operation being executed

1: programming, erase or option byte change operation being executed

4.9.6 FLASH clear control register (FLASH_CCR)

Address offset: 0x014

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.CLR_CRCRDERRCLR_CRCENDCLR_DBECCERRCLR_SNECCERRCLR_RDSERRCLR_RDPERRCLR_OPERRCLR_INCERRRes.CLR_STRBERRCLR_PGSERRCLR_WRPERRCLR_EOP
wwwwwwwwwwww
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.

Bits 31:29 Reserved, must be kept at reset value.

Bit 28 CLR_CRCRDERR : CRCRDERR flag clear bit

Setting this bit to 1 resets to 0 CRCRDERR flag in FLASH_SR register.

Bit 27 CLR_CRCEND : CRCEND flag clear bit

Setting this bit to 1 resets to 0 CRCEND flag in FLASH_SR register.

Bit 26 CLR_DBECCERR : DBECCERR flag clear bit

Setting this bit to 1 resets to 0 DBECCERR flag in FLASH_SR register. If the SNECCERR flag of FLASH_SR register is set to 0, FLASH_ECC_FAR register is reset to 0 as well.

Bit 25 CLR_SNECCERR : SNECCERR flag clear bit

Setting this bit to 1 resets to 0 SNECCERR flag in FLASH_SR register. If the DBECCERR flag of FLASH_SR register is set to 0, FLASH_ECC_FAR register is reset to 0 as well.

Bit 24 CLR_RDSERR : RDSERR flag clear bit

Setting this bit to 1 resets to 0 RDSERR flag in FLASH_SR register.

Bit 23 CLR_RDPERR : RDPERR flag clear bit

Setting this bit to 1 resets to 0 RDPERR flag in FLASH_SR register.

Bit 22 CLR_OPERR : OPERR flag clear bit

Setting this bit to 1 resets to 0 OPERR flag in FLASH_SR register.

Bit 21 CLR_INCERR : INCERR flag clear bit

Setting this bit to 1 resets to 0 INCERR flag in FLASH_SR register.

Bit 20 Reserved, must be kept at reset value.

Bit 19 CLR_STRBERR : STRBERR flag clear bit

Setting this bit to 1 resets to 0 STRBERR flag in FLASH_SR register.

Bit 18 CLR_PGSERR : PGSERR flag clear bit

Setting this bit to 1 resets to 0 PGSERR flag in FLASH_SR register.

Bit 17 CLR_WRPERR : WRPERR flag clear bit

Setting this bit to 1 resets to 0 WRPERR flag in FLASH_SR register.

Bit 16 CLR_EOP : EOP flag clear bit

Setting this bit to 1 resets to 0 EOP flag in FLASH_SR register.

Bits 15:0 Reserved, must be kept at reset value.

4.9.7 FLASH option control register (FLASH_OPTCR)

Address offset: 0x018

Reset value: 0xX000 0001

31302928272625242322212019181716
Res.OPTCHANGERRIERes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
w
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OPTSTARTOPTLOCK
wrs

Bit 31 Reserved, must be kept at reset value.

Bit 30 OPTCHANGERRIE : Option byte change error interrupt enable bit

OPTCHANGERRIE bit controls if an interrupt has to be generated when an error occurs during an option byte change.

0: no interrupt is generated when an error occurs during an option byte change

1: an interrupt is generated when an error occurs during an option byte change.

Bits 29:5 Reserved, must be kept at reset value.

Bits 4:2 Reserved, must be kept at reset value.

Bit 1 OPTSTART : Option byte start change option configuration bit

OPTSTART triggers an option byte change operation. The user can set OPTSTART only when the OPTLOCK bit is set to 0. The embedded Flash memory resets OPTSTART when the option byte change operation has been acknowledged.

The user application cannot modify any embedded Flash memory register until the option change operation has been completed.

Before setting this bit, the user has to write the required values in the FLASH_XXX_PRG registers. The FLASH_XXX_PRG registers will be locked until the option byte change operation has been executed in non-volatile memory.

It is not possible to start an option byte change operation if a CRC calculation is ongoing.

Trying to set OPTSTART when CRC_BUSY of FLASH_SR register is set has no effect; the option byte change does not start and no error is generated.

Bit 0 OPTLOCK : FLASH_OPTCR lock option configuration bit

The OPTLOCK bit locks the FLASH_OPTCR register as well as all _PRG registers. The correct write sequence to FLASH_OPTKEYR register unlocks this bit. If a wrong sequence is executed, or the unlock sequence to FLASH_OPTKEYR is performed twice, this bit remains locked until next system reset.

It is possible to set OPTLOCK by programming it to 1. When set to 1, a new unlock sequence is mandatory to unlock it. When OPTLOCK changes from 0 to 1, the other bits of FLASH_OPTCR register do not change.

0: FLASH_OPTCR register unlocked

1: FLASH_OPTCR register locked.

4.9.8 FLASH option status register (FLASH_OPTSR_CUR)

Address offset: 0x01C

Reset value: 0xXXXX XXXX

Refer to Table 18: Option byte organization for details on the reset value.

This read-only register reflects the current values of corresponding option bits.

31302928272625242322212019181716
Res.OPTCHANGERRIO_HSLVRes.Res.Res.Res.Res.Res.Res.SECURITYST_RAM_SIZE[1:0]IWDG_FZ_SDBYIWDG_FZ_STOPRes.
rrrrr11
1514131211109876543210
RDP[7:0]NRST_STDY_D1NRST_STOP_D1Res.IWDG1_SWBOR_LEV[1:0]Res.OPT_BUSY
rrrrrrrrrrrr1r

Bit 31 Reserved, must be kept at reset value.

Bit 30 OPTCHANGEERR : Option byte change error flag

OPTCHANGEERR flag indicates that an error occurred during an option byte change operation. When OPTCHANGEERR is set to 1, the option byte change operation did not successfully complete. An interrupt is generated when this flag is raised if the OPTCHANGEERRIE bit of FLASH_OPTCR register is set to 1.

Writing 1 to CLR_OPTCHANGEERR of register FLASH_OPTCCR clears OPTCHANGEERR.

0: no option byte change errors occurred

1: one or more errors occurred during an option byte change operation.

Bit 29 IO_HSLV : I/O high-speed at low-voltage status bit

This bit indicates that the product operates below 2.5 V.

0: Product working in the full voltage range, I/O speed optimization at low-voltage disabled

1: Product operating below 2.5 V, I/O speed optimization at low-voltage feature allowed

Bits 28:26 Reserved, must be kept at reset value.

Bits 25:22 Reserved, must be kept at reset value.

Bit 21 SECURITY : Security enable option status bit

0: Security feature disabled

1: Security feature enabled.

Bits 20:19 ST_RAM_SIZE[1:0] : ST RAM size option status

00: 2 Kbytes reserved to ST code

01: 4 Kbytes reserved to ST code

10: 8 Kbytes reserved to ST code

11: 16 Kbytes reserved to ST code

Note: This bitfield is effective only when the security is enabled (SECURITY = 1).

The whole DTCM RAM is always available for the application whatever ST_RAM_SIZE option byte configuration.

Bit 18 IWDG_FZ_SDBY : IWDG Standby mode freeze option status bit

When set the independent watchdog IWDG1 is frozen in system Standby mode.

0: Independent watchdog frozen in Standby mode

1: Independent watchdog keep running in Standby mode.

Bit 17 IWDG_FZ_STOP : IWDG Stop mode freeze option status bit

When set the independent watchdog IWDG1 is in system Stop mode.

0: Independent watchdog frozen in system Stop mode

1: Independent watchdog keep running in system Stop mode.

Bit 16 Reserved, must be kept at reset value.

Bits 15:8 RDP[7:0] : Readout protection level option status byte

0xAA: global readout protection level 0

0xCC: global readout protection level 2

others values: global readout protection level 1.

Bit 7 NRST_STDY_D1 : D1 domain DStandby entry reset option status bit

0: a reset is generated when entering DStandby mode on D1 domain

1: no reset generated when entering DStandby mode on D1 domain

Bit 6 NRST_STOP_D1 : D1 domain DStop entry reset option status bit

0: a reset is generated when entering DStop mode on D1 domain

1: no reset generated when entering DStop mode on D1 domain.

Bit 5 Reserved, must be kept at reset value.

Bit 4 IWDG1_SW : IWDG1 control mode option status bit

1: IWDG1 watchdog is controlled by software

0: IWDG1 watchdog is controlled by hardware.

Bits 3:2 BOR_LEV[1:0] : Brownout level option status bit

These bits reflects the power level that generates a system reset.

00: Brownout reset threshold 0 ( \( V_{BOR0} \) )

01: Brownout reset threshold 1 ( \( V_{BOR1} \) )

10: Brownout reset threshold 2 ( \( V_{BOR2} \) )

11: Brownout reset threshold 3 ( \( V_{BOR3} \) )

Bit 1 Reserved, must be kept at reset value.

Bit 0 OPT_BUSY : Option byte change ongoing flag

OPT_BUSY indicates if an option byte change is ongoing. When this bit is set to 1, the embedded Flash memory is performing an option change and it is not possible to modify any embedded Flash memory register.

0: no option byte change ongoing

1: an option byte change ongoing and all write accesses to Flash registers are blocked until the option byte change completes.

4.9.9 FLASH option status register (FLASH_OPTSR_PRG)

Address offset: 0x020

Reset value: 0xXXXX XXXX

Refer to Table 18: Option byte organization for details on the reset value.

This register is used to program values in corresponding option bits. Values after reset reflects the current values of the corresponding option bits.

31302928272625242322212019181716
Res.Res.IO_HSLVRes.Res.Res.Res.Res.Res.Res.SECURITYST_RAM_SIZE[1:0]IWDG_FZ_SDBYIWDG_FZ_STOPRes.
rwrwrwrw
1514131211109876543210
RDP[7:0]NRST_STDY_D1NRST_STOP_D1Res.IWDG1_SWBOR_LEV[1:0]Res.Res.
rwrwrwrwrw
rwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:30 Reserved, must be kept at reset value.

Bit 29 IO_HSLV : I/O high-speed at low-voltage configuration bit

This bit indicates that the product operates below 2.5 V.

0: Product working in the full voltage range, I/O speed optimization at low-voltage disabled

1: Product operating below 2.5 V, I/O speed optimization at low-voltage feature allowed

Bits 28:26 Reserved, must be kept at reset value.

Bits 25:22 Reserved, must be kept at reset value.

Bit 21 SECURITY : Security enable option configuration bit

The SECURITY option bit enables the secure access mode of the device during an option byte change. The change will be taken into account at next power-on reset. Once it is enabled, the security feature can be disabled if no areas are protected by PCROP or Secure access mode. If there are secure-only or PCROP protected areas, perform a regression level (from level 1 to 0) and set all the bits to unprotect secure-only areas and PCROP areas.

0: Security feature disabled

1: Security feature enabled.

Bits 20:19 ST_RAM_SIZE[1:0] : ST RAM size option configuration bits

00: 2 Kbytes reserved to ST code

01: 4 Kbytes reserved to ST code

10: 8 Kbytes reserved to ST code

11: 16 Kbytes reserved to ST code

Note: This bitfield is effective only when the security is enabled (SECURITY = 1).

The whole DTCM RAM is always available for the application whatever ST_RAM_SIZE option byte configuration.

Bit 18 IWDG_FZ_SDBY : IWDG Standby mode freeze option configuration bit

This option bit is used to freeze or not the independent watchdog IWDG1 in system Standby mode.

0: Independent watchdog frozen in Standby mode

1: Independent watchdog keep running in Standby mode.

Bit 17 IWDG_FZ_STOP : IWDG Stop mode freeze option configuration bit

This option bit is used to freeze or not the independent watchdog IWDG1 in system Stop mode.

0: Independent watchdog frozen in system Stop mode

1: Independent watchdog keep running in system Stop mode.

Bit 16 Reserved, must be kept at reset value.

Bits 15:8 RDP[7:0] : Readout protection level option configuration bits

RDP bits are used to change the readout protection level. This change is possible only when the current protection level is different from level 2. The possible configurations are:

0xAA: global readout protection level 0

0xCC: global readout protection level 2

others values: global readout protection level 1.

Bit 7 NRST_STDY_D1 : D1 domain DStandby entry reset option configuration bit

0: a reset is generated when entering DStandby mode on D1 domain.

1: no reset generated when entering DStandby mode on D1 domain

Bit 6 NRST_STOP_D1 : D1 domain DStop entry reset option configuration bit

0: a reset is generated when entering DStop mode on D1 domain.

1: no reset generated when entering DStop mode on D1 domain.

Bit 5 Reserved, must be kept at reset value.

Bit 4 IWDG1_SW : IWDG1 control mode option configuration bit

IWDG1_SW option bit is used to select if IWDG1 independent watchdog is controlled by hardware or by software.

1: IWDG1 watchdog is controlled by software.

0: IWDG1 watchdog is controller by hardware.

Bits 3:2 BOR_LEV[1:0] : Brownout level option configuration bit

These option bits are used to define the power level that generates a system reset.

00 and 11: the reset level is set to 2.1 V

01: the reset is set to 2.4 V

10: the reset is set to 2.7 V

Bits 1:0 Reserved, must be kept at reset value.

4.9.10 FLASH option clear control register (FLASH_OPTCCR)

Address offset: 0x024

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.CLR_OPTCHANGEERRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
w

1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.

Bit 31 Reserved, must be kept at reset value.

Bit 30 CLR_OPTCHANGEERR : OPTCHANGEERR reset bit

This bit is used to reset the OPTCHANGEERR flag in FLASH_OPTSR_CUR or FLASH_OPTSR2_CUR register. FLASH_OPTCCR is write-only.

It is reset by programming it to 1.

Bits 29:0 Reserved, must be kept at reset value.

4.9.11 FLASH protection address (FLASH_PRAR_CUR)

Address offset: 0x028

Reset value: 0xXXXX 0XXX

Refer to Table 18: Option byte organization for details on the reset value.

This read-only register reflects the current values of corresponding option bits.

31302928272625242322212019181716
DMEPRes.Res.Res.PROT_AREA_END[11:0]
rrrrrrrrrrrrr

1514131211109876543210
Res.Res.Res.Res.PROT_AREA_START[11:0]
rrrrrrrrrrrr

Bit 31 DMEP : PCROP protected erase enable option status bit

If DMEP is set to 1, the PCROP protected area is erased when a protection level regression (change from level 1 to 0) or a bank erase with protection removal occurs.

Bits 30:28 Reserved, must be kept at reset value.

Bits 27:16 PROT_AREA_END[11:0] : PCROP area end status bits

These bits contain the last 256-byte block of the PCROP area.

If this address is equal to PROT_AREA_START, the whole bank is PCROP protected.

If this address is lower than PROT_AREA_START, no protection is set.

Bits 15:12 Reserved, must be kept at reset value.

Bits 11:0 PROT_AREA_START[11:0] : PCROP area start status bits

These bits contain the first 256-byte block of the PCROP area.

If this address is equal to PROT_AREA_END, the whole bank is PCROP protected.

If this address is higher than PROT_AREA_END, no protection is set.

4.9.12 FLASH protection address (FLASH_PRAR_PRG)

Address offset: 0x02C

Reset value: 0xXXXX 0XXX

Refer to Table 18: Option byte organization for details on the reset value.

This register is used to program values in corresponding option bits.

31302928272625242322212019181716
DMEPRes.Res.Res.PROT_AREA_END[11:0]
rwrwrwrwrwrwrwrwrwrwrwrwrw

1514131211109876543210
Res.Res.Res.Res.PROT_AREA_START[11:0]
rwrwrwrwrwrwrwrwrwrwrwrw

Bit 31 DMEP : PCROP protected erase enable option configuration bit

If DMEP is set to 1, the PCROP protected area is erased when a protection level regression (change from level 1 to 0) or a bank erase with protection removal occurs.

Bits 30:28 Reserved, must be kept at reset value.

Bits 27:16 PROT_AREA_END[11:0] : PCROP area end configuration bits

These bits contain the last 256-byte block of the PCROP area.

If this address is equal to PROT_AREA_START, the whole bank is PCROP protected.

If this address is lower than PROT_AREA_START, no protection is set.

Bits 15:12 Reserved, must be kept at reset value.

Bits 11:0 PROT_AREA_START[11:0] : PCROP area start configuration bits

These bits contain the first 256-byte block of the PCROP area.

If this address is equal to PROT_AREA_END, the whole bank is PCROP protected.

If this address is higher than PROT_AREA_END, no protection is set.

4.9.13 FLASH secure address (FLASH_SCAR_CUR)

Address offset: 0x030

Reset value: 0xXXXX 0XXX

Refer to Table 18: Option byte organization for details on the reset value.

This read-only register reflects the current values of corresponding option bits.

31302928272625242322212019181716
DMESRes.Res.Res.SEC_AREA_END[11:0]
rrrrrrrrrrrrr
1514131211109876543210
Res.Res.Res.Res.SEC_AREA_START[11:0]
rrrrrrrrrrrr

Bit 31 DMES : secure access protected erase enable option status bit

If DMES is set to 1, the secure access only area is erased when a protection level regression (change from level 1 to 0) or a bank erase with protection removal occurs.

Bits 30:28 Reserved, must be kept at reset value.

Bits 27:16 SEC_AREA_END[11:0] : secure-only area end status bits

These bits contain the last 256-byte block of the secure-only area.

If this address is equal to SEC_AREA_START, the whole bank is secure access only.

If this address is lower than SEC_AREA_START, no protection is set.

Bits 15:12 Reserved, must be kept at reset value.

Bits 11:0 SEC_AREA_START[11:0] : secure-only area start status bits

These bits contain the first 256 bytes of block of the secure-only area.

If this address is equal to SEC_AREA_END, the whole bank is secure access only.

If this address is higher than SEC_AREA_END, no protection is set.

4.9.14 FLASH secure address (FLASH_SCAR_PRG)

Address offset: 0x034

Reset value: 0xXXXX 0XXX

Refer to Table 18: Option byte organization for details on the reset value.

This register is used to program values in corresponding option bits.

31302928272625242322212019181716
DMESRes.Res.Res.SEC_AREA_END[11:0]
rwrwrwrwrwrwrwrwrwrwrwrwrw

1514131211109876543210
Res.Res.Res.Res.SEC_AREA_START[11:0]
rwrwrwrwrwrwrwrwrwrwrwrw

Bit 31 DMES : Secure access protected erase enable option configuration bit

If DMES is set to 1, the secure access only area is erased when a protection level regression (change from level 1 to 0) or a bank erase with protection removal occurs.

Bits 30:28 Reserved, must be kept at reset value.

Bits 27:16 SEC_AREA_END[11:0] : Secure-only area end configuration bits

These bits contain the last block of 256 bytes of the secure-only area.
If this address is equal to SEC_AREA_START, the whole bank is secure access only.
If this address is lower than SEC_AREA_START, no protection is set.

Bits 15:12 Reserved, must be kept at reset value.

Bits 11:0 SEC_AREA_START[11:0] : Secure-only area start configuration bits

These bits contain the first block of 256 bytes of the secure-only area.
If this address is equal to SEC_AREA_END, the whole bank is secure access only.
If this address is higher than SEC_AREA_END, no protection is set.

4.9.15 FLASH write sector protection (FLASH_WPSN_CUR)

Address offset: 0x038

Reset value: 0x0000 00XX

This read-only register reflects the current values of corresponding option bits.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.

1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.WRPS7WRPS6WRPS5WRPS4WRPS3WRPS2WRPS1WRPS0
rrrrrrrr

Bits 31:8 Reserved, must be kept at reset value.

Bits 7:0 WRPSn : Sector n write protection option status bit (n = 7 to 0)

Each FLASH_WPSN_CUR bit reflects the write protection status of the corresponding sector (0: sector is write protected; 1: sector is not write protected)

4.9.16 FLASH write sector protection (FLASH_WPSN_PRG)

Address offset: 0x03C

Reset value: 0x0000 00XX

This register is used to program values in corresponding option bits.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.WRPS7WRPS6WRPS5WRPS4WRPS3WRPS2WRPS1WRPS0
rwrwrwrwrwrwrwrw

Bits 31:8 Reserved, must be kept at reset value.

Bits 7:0 WRPSn : Sector n write protection option status bit (n = 7 to 0)

Setting WRPSn bit to 0 write protects the corresponding sector (0: sector is write protected; 1: sector is not write protected).

4.9.17 FLASH register boot address for Arm® Cortex®-M7 core (FLASH_BOOT_CUR)

Address offset: 0x040

Reset value: 0xXXXX XXXX

Refer to Table 18: Option byte organization for details on the reset value.

This register reflects the current values of corresponding option bits.

31302928272625242322212019181716
BOOT_CM_ADD1[15:0]
rrrrrrrrrrrrrrrr
1514131211109876543210
BOOT_CM_ADD0[15:0]
rrrrrrrrrrrrrrrr

Bits 31:16 BOOT_CM_ADD1[15:0] : Arm® Cortex®-M7 boot address 1

These bits reflect the MSB of the Arm® Cortex®-M7 boot address when the BOOT pin is high.

Bits 15:0 BOOT_CM_ADD0[15:0] : Arm® Cortex®-M7 boot address 0

These bits reflect the MSB of the Arm® Cortex®-M7 boot address when the BOOT pin is low.

4.9.18 FLASH register boot address for Arm ® Cortex ® -M7 core (FLASH_BOOT_PRG)

Address offset: 0x044

Reset value: 0xXXXX XXXX

Refer to Table 18: Option byte organization for details on the reset value.

This register is used to program values in corresponding option bits.

31302928272625242322212019181716
BOOT_CM_ADD1[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
BOOT_CM_ADD0[15:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:16 BOOT_CM_ADD1[15:0] : Arm ® Cortex ® -M7 boot address 1 configuration

These bits allow configuring the MSB of the Arm ® Cortex ® -M7 boot address when the BOOT pin is high.

Bits 15:0 BOOT_CM_ADD0[15:0] : Arm ® Cortex ® -M7 boot address 0 configuration

These bits allow configuring the MSB of the Arm ® Cortex ® -M7 boot address when the BOOT pin is low.

4.9.19 FLASH CRC control register (FLASH_CRCCR)

Address offset: 0x050

Reset value: 0x001C 0000

This register can be modified only if CRC_EN bit is set to 1 in FLASH_CR register.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.ALL_BANKCRC_BURST[1:0]Res.Res.CLEAN_CRCSTART_CRC
wrwrwrrw
1514131211109876543210
Res.Res.Res.Res.Res.CLEAN_SECTADD_SECTCRC_BY_SECTRes.Res.Res.Res.Res.CRC_SECT[2:0]
wwrrwrrw

Bits 31:23 Reserved, must be kept at reset value.

Bit 22 ALL_BANK : CRC select bit

When ALL_BANK is set to 1, all bank user sectors are added to list of sectors on which the CRC is calculated.

Bits 21:20 CRC_BURST[1:0] : CRC burst size

CRC_BURST bits set the size of the bursts that are generated by the CRC calculation unit.

00: every burst has a size of 4 Flash words (256-bit)

01: every burst has a size of 16 Flash words (256-bit)

10: every burst has a size of 64 Flash words (256-bit)

11: every burst has a size of 256 Flash words (256-bit)

Bits 19:18 Reserved, must be kept at reset value.

Bit 17 CLEAN_CRC : CRC clear bit

Setting CLEAN_CRC to 1 clears the current CRC result stored in the FLASH_CRCDATAR register.

Bit 16 START_CRC : CRC start bit

START_CRC bit triggers a CRC calculation using the current configuration. No CRC calculation can be launched when an option byte change operation is ongoing because all write accesses to embedded Flash memory registers are put on hold until the option byte change operation has completed.

Bits 15:11 Reserved, must be kept at reset value.

Bit 10 CLEAN_SECT : CRC sector list clear bit

Setting CLEAN_SECT to 1 clears the list of sectors on which the CRC is calculated.

Bit 9 ADD_SECT : CRC sector select bit

Setting ADD_SECT to 1 adds the sector whose number is CRC_SECT to the list of sectors on which the CRC is calculated.

Bit 8 CRC_BY_SECT : CRC sector mode select bit

When CRC_BY_SECT is set to 1, the CRC calculation is performed at sector level, on the sectors present in the list of sectors. To add a sector to this list, use ADD_SECT and CRC_SECT bits. To clean the list, use CLEAN_SECT bit.

When CRC_BY_SECT is reset to 0, the CRC calculation is performed on all addresses between CRC_START_ADDR and CRC_END_ADDR.

Bits 7:3 Reserved, must be kept at reset value.

Bits 2:0 CRC_SECT[2:0] : CRC sector number

CRC_SECT is used to select one or more user Flash sectors to be added to the list of sectors on which the CRC is calculated. The CRC can be computed either between two addresses (using registers FLASH_CRCSADDR and FLASH_CRCEADDR) or on a list of sectors. If this latter option is selected, it is possible to add a sector to the list of sectors by programming the sector number in CRC_SECT and then setting ADD_SECT to 1.

The list of sectors can be erased either by setting CLEAN_SECT bit or by disabling the CRC computation. CRC_SECT can be set only when CRC_EN of FLASH_CR register is set to 1.

000: sector 0

001: sector 1

...

111: sector 7

4.9.20 FLASH CRC start address register (FLASH_CRCSADDR)

Address offset: 0x054

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CRC_START_ADDR[19:16]
rwrwrwrw
1514131211109876543210
rwrwrwrwrwrwrwrwrwrwrwrwrwrw
CRC_START_ADDR[15:2]Res.Res.

Bits 31:20 Reserved, must be kept at reset value.

Bits 19:2 CRC_START_ADDR[19:2] : CRC start address

CRC_START_ADDR is used when CRC_BY_SECT is set to 0. It must be programmed to the start address of the bank memory area on which the CRC calculation is performed.

Bits 1:0 Reserved, must be kept at reset value.

4.9.21 FLASH CRC end address register (FLASH_CRCEADDR)

Address offset: 0x058

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CRC_END_ADDR[19:16]
rwrwrwrw
1514131211109876543210
rwrwrwrwrwrwrwrwrwrwrwrwrwrw
CRC_END_ADDR[15:2]Res.Res.

Bits 31:20 Reserved, must be kept at reset value.

Bits 19:2 CRC_END_ADDR[19:2] : CRC end address

CRC_END_ADDR is used when CRC_BY_SECT is set to 0. It must be programmed to the end address of the bank memory area on which the CRC calculation is performed

Bits 1:0 Reserved, must be kept at reset value.

4.9.22 FLASH CRC data register (FLASH_CRCDATAR)

Address offset: 0x05C

Reset value: 0x0000 0000

31302928272625242322212019181716
CRC_DATA[31:16]
rrrrrrrrrrrrrrrr
1514131211109876543210
CRC_DATA[15:0]
rrrrrrrrrrrrrrrr

Bits 31:0 CRC_DATA[31:0] : CRC result

CRC_DATA bits contain the result of the last CRC calculation.

4.9.23 FLASH ECC fail address (FLASH_ECC_FAR)

Address offset: 0x060

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.FAIL_ECC_ADDR[14:0]
rrrrrrrrrrrrrrr

Bits 31:15 Reserved, must be kept at reset value.

Bits 14:0 FAIL_ECC_ADDR[14:0] : ECC error address

When an ECC error occurs (both for single correction or double detection) during a read operation, the FAIL_ECC_ADDR bitfield contains the address that generated the error.

FAIL_ECC_ADDR is reset when the flag error in the FLASH_SR register (CLR_SNECCERR or CLR_DBECCERR) is reset.

The embedded Flash memory programs the address in this register only when no ECC error flags are set. This means that only the first address that generated an ECC error is saved.

The address in FAIL_ECC_ADDR is relative to the Flash area where the error occurred (user Flash, system Flash).

Fail address = FAIL_ECC_ADDR[14:0] * 32 + Flash bank offset

4.9.24 FLASH option status register 2 (FLASH_OPTSR2_CUR)

Address offset: 0x070

Reset value: 0x0000 000X

Refer to Table 18: Option byte organization for details on the reset value.

This read-only register reflects the current values of corresponding option bits.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CPUFREQ_BOOSTTCM_AXI_SHARED[1:0]
rrr

Bits 31:3 Reserved, must be kept at reset value.

Bit 2 CPUFREQ_BOOST : CPU frequency boost status bit

This bit indicates whether the CPU frequency can be boosted or not. When it is set, the ECC on ITCM and DTCM are no more used.

Bits 1:0 TCM_AXI_SHARED[1:0] : TCM RAM sharing status bit

This bitfield contains the ITCM memory size and the AXI system RAM.

00: 64-Kbyte ITCM / 320 Kbyte system AXI

01: 128-Kbyte ITCM / 256-Kbyte system AXI

10: 192-Kbyte ITCM / 192-Kbyte system AXI

11: 256-Kbyte ITCM / 128-Kbyte system AXI

4.9.25 FLASH option status register 2 (FLASH_OPTSR2_PRG)

Address offset: 0x074

Reset value: 0x0000 000X

Refer to Table 18: Option byte organization for details on the reset value.

This register is used to program values in corresponding option bits. Values after reset reflects the current values of the corresponding option bits.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CPUFREQ_BOOSTTCM_AXI_SHARED[1:0]
rwrwrw

Bits 31:3 Reserved, must be kept at reset value.

Bit 2 CPUFREQ_BOOST : CPU frequency boost status bit

This bit configures whether the CPU frequency can be boosted or not. When it is set, the ECC on ITCM and DTCM are no more used.

Bits 1:0 TCM_AXI_SHARED[1:0] : TCM RAM sharing status bit

This bitfield configures the ITCM memory size and the AXI system RAM.

00: 64-Kbyte ITCM / 320 Kbyte system AXI

01: 128-Kbyte ITCM / 256-Kbyte system AXI

10: 192-Kbyte ITCM / 192-Kbyte system AXI

11: 256-Kbyte ITCM / 128-Kbyte system AXI

4.10 FLASH register map and reset values

Table 25. Register map and reset value table

OffsetRegister name reset313029282726252423222120191817161514131211109876543210
0x000FLASH_ACRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.WRHIGHFREQ11011
0x00000037
0x004FLASH_KEYRKEYKEYRR
0x0000000000000000000000000000000000000000
0x008FLASH_OPTKEYROPTKEYR
0x0000000000000000000000000000000000000000
0x00CFLASH_CRRes.Res.Res.CRCDERRIECRCENDIEDBECCERRIESNECCERRIERDSERRIERDPERRIEOPERIEINCERRIERes.STRBERRIEPGSERRIEWRPERRIEEOPCRC_ENRes.Res.Res.Res.SNB000STARTFWPSIZE11BERSERPGLOCK
0x00000031000000000000010001
0x010FLASH_SRRes.Res.Res.CRCDERRCRCENDDBECCERRSNECCERRRDSERRRDPERROPERIEINCERRRes.STRBERRPGSERRWRPERREOPRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.0000
0x000000000000000000000000
0x014FLASH_CCRRes.Res.Res.CLR_CRCDERRCLR_CRCENDCLR_DBECCERRCLR_SNECCERRCLR_RDSERRCLR_RDPERRCLR_OPERIECLR_INCERRRes.CLR_STRBERRCLR_PGSERRCLR_WRPERRCLR_EOPRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
0x00000000000000000000
0x018FLASH_OPTCRRes.OPTCHANGERRIERes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.OPTSTARTOPTLOCK
0x00000001001
0x01CFLASH_OPTSR_CURRes.OPTCHANGERRIO_HSLVRes.Res.Res.Res.Res.Res.SECURITYST_RAM_SIZEIMDG_FZ_SDBYIMDG_FZ_STOPRDP[7:0]NRST_STBY_D1NRST_STOP_D1Res.IMDG1_SWBOR_LEVRes.OPT_BUSY
0xXXXX XXXXXXXXXXXXXXXX

Table 25. Register map and reset value table (continued)

OffsetRegister name reset313029282726252423222120191817161514131211109876543210
Res.Res.IO_HSLVRes.Res.Res.Res.Res.Res.Res.SECURITYST_RAM_SIZERes.IMDG_FZ_SDBYIMDG_FZ_STOPRes.RDP[7:0]NRST_STBY_D1NRST_STOP_D1Res.IWDG1_SWBOR_LEVRes.Res.
0x020FLASH_OPTSR_PRG
0xXXXX XXXXXXXXXXXXXXXXXXXXXXXX
0x024FLASH_OPTCCRRes.CLR_OPTCHANGEERRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
0x000000000
0x028FLASH_PRAR_CURDMEPRes.Res.Res.PROT_AREA_END[11:0]Res.Res.Res.Res.PROT_AREA_START[11:0]
0xXXXX 0XXXX
0x02CFLASH_PRAR_PRGDMEPRes.Res.Res.PROT_AREA_END[11:0]Res.Res.Res.Res.PROT_AREA_START[11:0]
0xXXXX 0XXXX
0x030FLASH_SCAR_CURDMESRes.Res.Res.SEC_AREA_END[11:0]Res.Res.Res.Res.SEC_AREA_START[11:0]
0xXXXX 0XXXX

Table 25. Register map and reset value table (continued)

OffsetRegister name reset313029282726252423222120191817161514131211109876543210
0x034FLASH_SCAR_PRGDMESRes.Res.Res.SEC_AREA_END[11:0]Res.Res.Res.Res.SEC_AREA_START[11:0]
0xXXXX 0XXXXXXXXXXXXXXXXXXXXXXXXXXXX
0x038FLASH_WPSN_CURRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.WRPSn
0x0000 00XX0XXXXXXXX
0x03CFLASH_WPSN_PRGRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.WRPSn
0x0000 00XXXXXXXXXX
0x040FLASH_BOOT_CURBOOT_CM_ADD1[15:0]BOOT_CM_ADD0[15:0]
0xXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0x044FLASH_BOOT_PRGBOOT_CM_ADD1[15:0]BOOT_CM_ADD0[15:0]
0xXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
0x050FLASH_CRCCRRes.Res.Res.Res.Res.Res.Res.Res.Res.ALL_BANKCRC_BURSTRes.Res.CLEAN_CRCSTART_CRCRes.Res.Res.Res.Res.Res.CLEAN_SECTADD_SECTCRC_BY_SECTRes.Res.Res.Res.Res.Res.CRC_SECT
0x001C00000010000000
0x054FLASH_CRCADDRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CRC_START_ADDR[31:0]Res.Res.
0x0000000000000000000000000000
0x058FLASH_CRCEADDRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CRC_END_ADDR[31:0]Res.Res.
0x0000000000000000000000000000
0x05CFLASH_CRCDATARCRC_DATA[31:0]
0x0000000000000000000000000000000000000000
0x060FLASH_ECC_FARRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.FAIL_ECC_ADDR[14:0]
0x00000000000000000000000
0x070FLASH_OPTSR2_CURRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CPUFREQ_BOOSTTCM_AXI_SHARED[1:0]
0xXXXX 0XXX

Table 25. Register map and reset value table (continued)

OffsetRegister name reset313029282726252423222120191817161514131211109876543210
0x074FLASH_OPTSR2
_PRG
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.CPUFREQ_BOOSTTOM_AXI_SHARED[1:0]
0xXXXX 0XXX

Refer to Section 2.3 on page 131 for the register boundary addresses.