Contents RM0440
4/2126 RM0440 Rev 4
3.7.18 Flash Securable area bank2 register (FLASH_SEC2R) . . . . . . . . . . . 144
3.7.19 FLASH register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
4 Embedded Flash memory (FLASH)
for category 4 devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
4.2 FLASH main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
4.3 FLASH functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
4.3.1 Flash memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
4.3.2 Error code correction (ECC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
4.3.3 Read access latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
4.3.4 Adaptive real-time memory accelerator (ART Accelerator) . . . . . . . . . 150
4.3.5 Flash program and erase operations . . . . . . . . . . . . . . . . . . . . . . . . . . 153
4.3.6 Flash main memory erase sequences . . . . . . . . . . . . . . . . . . . . . . . . . 154
4.3.7 Flash main memory programming sequences . . . . . . . . . . . . . . . . . . . 155
4.4 FLASH option bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
4.4.1 Option bytes description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
4.4.2 Option bytes programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
4.5 FLASH memory protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
4.5.1 Read protection (RDP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
4.5.2 Proprietary code readout protection (PCROP) . . . . . . . . . . . . . . . . . . 168
4.5.3 Write protection (WRP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
4.5.4 Securable memory area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
4.5.5 Disabling core debug access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
4.5.6 Forcing boot from Flash memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
4.6 FLASH interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
4.7 FLASH registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
4.7.1 Flash access control register (FLASH_ACR) . . . . . . . . . . . . . . . . . . . 173
4.7.2 Flash Power-down key register (FLASH_PDKEYR) . . . . . . . . . . . . . . 174
4.7.3 Flash key register (FLASH_KEYR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
4.7.4 Flash option key register (FLASH_OPTKEYR) . . . . . . . . . . . . . . . . . . 175
4.7.5 Flash status register (FLASH_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
4.7.6 Flash control register (FLASH_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
4.7.7 Flash ECC register (FLASH_ECCR) . . . . . . . . . . . . . . . . . . . . . . . . . . 179
4.7.8 Flash option register (FLASH_OPTR) . . . . . . . . . . . . . . . . . . . . . . . . . 180
4.7.9 Flash PCROP1 Start address register (FLASH_PCROP1SR) . . . . . . 182