Flash memory
Flash memory organization
The embedded Flash non-volatile memory is composed of:
• For STM32H743/753 devices: a 2-Mbyte main memory block, organized as
two banks of 1 Mbyte each. Each bank is in turn divided in eight 128-Kbyte
sectors and features Flash-word rows of 256 bits + 10 bits of ECC per word.
• A system memory block of 256 Kbytes, divided into two 128 Kbyte
banks. The system memory is ECC protected.
• A set of non-volatile option bytes loaded at reset by the embedded
Flash memory and accessible by the application software only through the AHB
configuration register interface.
Example Program
After Reset, the Flash memory Program/Erase Controller is locked. A
dedicated function is used to enable the FLASH control register access.
Before programming the desired addresses, an erase operation is
performed using the flash erase sector feature. The erase procedure is done by filling
the erase init structure giving the starting erase sector and the number of sectors to
erase.
At this stage, all these sectors will be erased one by one separately.
Once this operation is finished, sector word programming operation will
be performed in the Flash memory. The written data is then read back and checked.