Nonvolatile memory ECC
For STM32H72x/3x/4x/5x lines, the nonvolatile memory word (smallest programmable amount of memory) is 256 bits, while on STM32H7Ax/Bx lines, STM32H5 series, STM32C5 series, and STM32U5 series, it is 128 bits. Table 5 Nonvolatile memory ECC coverage in STM32 devices shows the word size for STM32 devices with ECC in nonvolatile memory. This is also the portion of memory protected by the bits required to achieve error detection and correction on the nonvolatile memory word. Write access to any smaller unit of memory is only possible on read-modify-write basis, this action results in higher stress to the memory hardware. The STM32H5 series, STM32C5 series, STM32U5 series, and STM32H7Ax/Bx line also feature added robustness on the small 0.5-2 Kbyte OTP area, where every 16 bits are protected with 6 bits of ECC redundancy. There is no OTP memory area on STM32H72x/3x/4x/5x lines.
| Memory | H72x/H73x |
Other | H7Ax/H7Bx | G0 |
G4/L4/L5/ | H503 |
H563/573 | L0/L11 |
U5 | U0 |
|---|---|---|---|---|---|---|---|---|---|---|
| Bank1 | 256b | 256b | 128b | 64b | 64b2 | 128b | 128b | 16b | 128b | 64b |
| Bank2 | - | 256b | 128b | 64b3 | 64b4 | - | 128b | 16b4 | 128b | - |
| Special region | - | - | 16b | - | - | - | 16b5 | - | - | - |
The ECC functionality is integrated into the nonvolatile memory controller and cannot be disabled. If the application is not designed to take advantage of the ECC, it can disable the associated interrupt and ignore the flag bits in the nonvolatile memory status registers.
The disadvantage of an integrated ECC solution is that programming single bits in the nonvolatile memory word is not possible without prior erase of this word. As programming without erase is sometimes used by implementations of EEPROM emulation or a monotonic counter, another algorithm must be selected for such applications on ECC enabled memories.
The flash memory controller of STM32H7 series implements also a hardware CRC integrity protection. The CRC is a complementary mechanism, not an ECC replacement. If the automated background CRC check is activated, the read access to the flash memory also implicitly checks the ECC in the whole range.