GD32A50x User Manual
54
only once. If any bit has been set 0, the entire double word cannot be written anymore, even
with the value 0x0000 0000 0000 0000.
2.3.2.
Error Checking and Correcting (ECC)
The ECC mechanism supports:
One error detection and correction
Two errors detection
When one error is detected and corrected:
When occurred in EEPROM backup / option bytes 0 (load option bytes 0 to register after
reset) / option bytes 1, the error is corrected without any notice.
When occurred in other space including read option bytes 0 by 0x1FFFF80x, the
ECCCOR bit in FMC_ECCCS register will be set. If the ECCCORIE bit in FMC_ECCCS
register is set, an interrupt is generated.The OTP_ECC / DF_ECC / SYS_ECC /
BK1_ECC / OB0_ECC notice the space that error occurred. The ECCADDR notice the
offset address in each space.
When two errors are detected:
When occurred in EEPROM backup, the EPECCDET bit in FMC_ECCCS register will
be set. If the ECCDETIE bit in FMC_ECCCS register is set, an interrupt is generated.
And the data return all F.
When occurred in option bytes 0 (load option bytes 0 to register after reset), the
OB0ECCDET bit in FMC_ECCCS register will be set. If the ECCDETIE bit in
FMC_ECCCS register is set, an interrupt is generated. And the data return all F.
When occurred in option bytes 1, the OB1ECCDET bit in FMC_ECCCS register will be
set. If the ECCDETIE bit in FMC_ECCCS register is set, an interrupt is generated. And
the data return all F.
When occurred in other space including read option bytes 0 at 0x1FFFF80x, the
ECCDET bit in FMC_ECCCS register and FLASHECCIF in SYSCFG_STAT register will
be set. And the NMI interrupt will be generated if FLASHECCIE bit in SYSCFG_CFG3
register is set. The OTP_ECC / DF_ECC / SYS_ECC / BK1_ECC / OB0_ECC notice the
space which error occurred. The ECCADDR notice the offset address in each space.
And the data return all F. The ECCDET bit in FMC_ECCCS register and FLASHECCIF
bit in SYSCFG_STAT register can be cleared by writing 1 to ECCDET bit in
FMC_ECCCS register or FLASHECCIF in SYSCFG_STAT register.
Note:
1. Data in
Flash memory are 72-bits words: 8 bits are added per double word (64 bits),
but the added 8bits are calculated by hardware and can not be accessed by user.
2. For a virgin data 0xFF FFFF FFFF FFFF FFFF, ECC is not supported.
The OTP_ECC / DF_ECC / SYS_ECC / BK1_ECC / OB0_ECC / ECCADDR notice the first
error occurred in single bit error and double bit errors. If ECCCOR or ECCDET set, the value
will not changed even if a new error occurred.