BER=B_0x0, PG=B_0x0, SSN=B_0x0, SER=B_0x0, LOCK=B_0x0
FLASH control register
LOCK | Configuration lock bit When this bit is set write to all other bits in this register, and to FLASH_IER register, are ignored. Clearing this bit requires the correct write sequence to FLASH_KEYR register (see this register for details). If a wrong sequence is executed, or if the unlock sequence is performed twice, this bit remains locked until the next system reset. During the write access to set LOCK bit from 0 to 1, it is possible to change the other bits of this register. 0 (B_0x0): FLASH_CR and FLASH_IER registers are unlocked 1 (B_0x1): Writes to FLASH_IER, and to other bits than LOCK in FLASH_CR, are ignored |
PG | Internal buffer control bit Setting this bit enables internal buffer for write operations. This allows preparing program operations even if a sector or bank erase is ongoing. When PG is cleared, 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. 0 (B_0x0): Internal buffer disabled for write operations 1 (B_0x1): Internal buffer enabled for write operations |
SER | Sector erase request Setting this bit requests a sector erase. Write protection error is triggered when a sector erase is required on at least one protected sector. BER has a higher priority than SER: if both bits are set, the embedded Flash memory executes a bank erase. 0 (B_0x0): Sector erase not requested 1 (B_0x1): Sector erase requested |
BER | Bank erase request Setting this bit requests a bank erase operation (user Flash memory only). Write protection error is triggered when a bank erase is required and some sectors are protected. BER has a higher priority than SER: if both are set, the embedded Flash memory executes a bank erase. 0 (B_0x0): Bank erase is not requested 1 (B_0x1): Bank erase is requested. Actual erase is started setting START bit in this register. |
FW | Force write This bit forces a write operation even if the write buffer is not full. In this case all bits not written are set by hardware. The embedded Flash memory resets FW when the corresponding operation has been 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). |
START | Erase start control bit This bit is used to start a sector erase or a bank erase operation. 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. |
SSN | Sector erase selection number These bits are used to select the target sector for an erase operation (they are unused otherwise). … 0 (B_0x0): Sector 0 1 (B_0x1): Sector 1 |
PG_OTP | Program Enable for OTP Area Set this bit to enable write operations to OTP area. |
CRC_EN | CRC enable Setting this bit 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 be disabled by clearing CRC_EN bit. Doing so sets CRCDATA to 0x0, clears CRC configuration and resets the content of FLASH_CRCDATAR register. |
ALL_BANKS | All banks select bit When this bit is set the erase is done on all Flash Memory sectors. ALL_BANKS is used only if a bank erase is required (BER=1). In all others operations, this control bit is ignored. |