Hard Processor System Technical Reference Manual: Agilex™ 5 SoCs

ID 814346
Date 11/27/2024
Public
Document Table of Contents

5.3.6.5.1. Error Correction

The NAND Flash controller corrects the data read from the flash device before being transferred to outside of the controller using a buffer (one per flash devices supported) with size of a ECC sector size. These buffers store the data read and the ECC engine is started to perform the error detection and correction if possible. After ECC correction the data is transferred outside of the controller. Each data sector can be marked as follows:

  • Error free: No errors were detected in the sector.
  • Correctable: Errors were found in the sector but the number didn’t exceed the correction capability.
  • Uncorrectable: Errors were found in the sector but the number of error exceeded the correction capability. In this case an uncorrectable error pattern should be reported. However, it is possible that the decoder behaves in random manner, reporting correctable pattern with wrong error locations or reporting no errors in sector. The probability of such random behavior is greater when the number of errors exceeds correction capability by more than one error and for smaller the correction capabilities.

The status field in descriptor in the CDMA work mode or cmd_status (0x0014) register in PIO mode contains ECC correction information for latest operation (last operation status register). At the end of data correction for the transaction in progress (that is, a set of pages or blocks read), this field or register holds the maximum number of corrections applied to any ECC sector in the transaction. In addition, this register indicates whether the transaction as a whole had correctable errors, uncorrectable errors, or no errors at all. A transaction has no errors when none of the ECC sectors in the transaction had any errors, the transaction is marked uncorrectable if any one of the sectors is uncorrectable, and the transaction is correctable when any one sector had correctable error and none of them is uncorrectable. The transaction is marked as erased if all blocks in transaction were identified as erased. It is good practice to read this field or register at the end of a transaction since this gives the host an idea about the health of the block read and may take any corrective action if the number of errors detected has reached a particular threshold.