|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2022-6-30 16:21:06
|
显示全部楼层
ECC错误、NMI中断都没处理,ECC之前还真没了解过,是写数据的时候才会触发的吗?
Data in Flash memory words are 72-bits wide: eight bits are added per each double word (64 bits). The ECC mechanism supports:
• One error detection and correction
• Two errors detection
When one error is detected and corrected, the flag ECCC (ECC correction) is set in FLASH ECC register (FLASH_ECCR). If ECCCIE is set, an interrupt is generated.
When two errors are detected, a flag ECCD (ECC detection) is set in FLASH ECC register (FLASH_ECCR). In this case, a NMI is generated.
When an ECC error is detected, the address of the failing double word is saved in ADDR_ECC[16:0] bitfield of the FLASH_ECCR register. ADDR_ECC[2:0] are always cleared. The bus-ID of the CPU accessing the address is saved in CPUID[2:0].
While ECCC or ECCD is set, FLASH_ECCR is not updated if a new ECC error occurs.
FLASH_ECCR is updated only when ECC flags are cleared.
Note: For a virgin data: 0xFF FFFF FFFF FFFF FFFF, one error is detected and corrected, but two errors detection is not supported.
When an ECC error is reported, a new read at the failing address may not generate an ECC error if the data is still present in the current buffer, even if ECCC and ECCD are cleared. If this is not the desired behavior, the user must reset the cache.
以下来自谷歌翻译:
闪存字中的数据为 72 位宽:每个双字(64 位)添加 8 位。 ECC 机制支持:
• 一次错误检测和纠正
• 两个错误检测
当检测到并纠正一个错误时,在 FLASH ECC 寄存器 (FLASH_ECCR) 中设置标志 ECCC(ECC 纠正)。如果设置了 ECCCIE,则会产生中断。
当检测到两个错误时,在 FLASH ECC 寄存器 (FLASH_ECCR) 中设置一个标志 ECCD(ECC 检测)。在这种情况下,会生成 NMI。
当检测到 ECC 错误时,失败双字的地址保存在 FLASH_ECCR 寄存器的 ADDR_ECC[16:0] 位域中。 ADDR_ECC[2:0] 总是被清除。访问该地址的 CPU 的总线 ID 保存在 CPUID[2:0] 中。
在设置 ECCC 或 ECCD 时,如果发生新的 ECC 错误,则不会更新 FLASH_ECCR。
FLASH_ECCR 仅在 ECC 标志被清除时更新。
注意:对于原始数据:0xFF FFFF FFFF FFFF FFFF,检测并纠正一个错误,但不支持检测两个错误。
当报告 ECC 错误时,如果数据仍然存在于当前缓冲区中,则在失败地址处的新读取可能不会产生 ECC 错误,即使 ECCC 和 ECCD 被清除也是如此。如果这不是期望的行为,用户必须重置缓存。
--------------------------------------------------------------------------------------
那么出现了ECC错误是意味这flash无法正常存储了吗?我该如何操作呢? |
|