SPRUIV7B May 2022 – September 2023 AM620-Q1 , AM623 , AM625 , AM625-Q1 , AM625SIP
In this example, the ELM module is programmed for a 16-bit error-correction capability in page mode (see Table 12-244). After reading a 528-byte NAND flash sector (512B data plus 16B spare area) with a 16-bit interface, four non-zero polynomial syndromes are reported from the GPMC (polynomial syndrome 0, 1, 2, and 3 are used in the ELM):
Step | Register/Bit Field/Programming Model | Value |
---|---|---|
Reset the module | ELM_SYSCONFIG[1] SOFTRESET | 0x1 |
Wait until reset is done. | ELM_SYSCONFIG[0] RESETDONE | 0x1 |
Configure the target interface power management: Smart idle is used. | ELM_SYSCONFIG[4-3] SIDLEMODE | 0x2 |
Define the error-correction level used: 16 bits | ELM_LOCATION_CONFIG[1-0] ECC_BCH_LEVEL | 0x2 |
Define the maximum buffer length: 528 bytes | ELM_LOCATION_CONFIG[26-16] ECC_SIZE | 0x420 |
Set the ELM in page mode (four blocks in a page) | ELM_PAGE_CTRL[0] SECTOR_0 | 0x1 |
ELM_PAGE_CTRL[1] SECTOR_1 | 0x1 | |
ELM_PAGE_CTRL[2] SECTOR_2 | 0x1 | |
ELM_PAGE_CTRL[3] SECTOR_3 | 0x1 | |
Disable all interrupts for syndrome polynomial and enable PAGE_MASK interrupt. | ELM_IRQENABLE | 0x100 |
Set the input syndrome polynomial 0. | ELM_SYNDROME_FRAGMENT_0_i (where i = 0) | 0xE0B718EF |
ELM_SYNDROME_FRAGMENT_1_i (where i = 0) | 0xA329AA05 | |
ELM_SYNDROME_FRAGMENT_2_i (where i = 0) | 0x8330B5CC | |
ELM_SYNDROME_FRAGMENT_3_i (where i = 0) | 0xB0693DB2 | |
ELM_SYNDROME_FRAGMENT_4_i (where i = 0) | 0x318E05BE | |
ELM_SYNDROME_FRAGMENT_5_i (where i = 0) | 0x12ADDB5A | |
ELM_SYNDROME_FRAGMENT_6_i (where i = 0) | 0xE8B0 | |
Set the input syndrome polynomial 1. | ELM_SYNDROME_FRAGMENT_0_i (where i = 1) | 0xE5F935EB |
ELM_SYNDROME_FRAGMENT_1_i (where i = 1) | 0x79C6BA10 | |
ELM_SYNDROME_FRAGMENT_2_i ((where i = 1) | 0xBE093336 | |
ELM_SYNDROME_FRAGMENT_3_i (where i = 1) | 0x0948DF08 | |
ELM_SYNDROME_FRAGMENT_4_i (where i = 1) | 0xC22E6669 | |
ELM_SYNDROME_FRAGMENT_5_i (where i = 1) | 0x49A0D932 | |
ELM_SYNDROME_FRAGMENT_6_i (where i = 1) | 0xBAD0 | |
Set the input syndrome polynomial 2. | ELM_SYNDROME_FRAGMENT_0_i (where i = 2) | 0x60BA3189 |
ELM_SYNDROME_FRAGMENT_1_i (where i = 2) | 0x1579EF7D | |
ELM_SYNDROME_FRAGMENT_2_i (where i = 2) | 0x54556EA0 | |
ELM_SYNDROME_FRAGMENT_3_i (where i = 2) | 0xA6498FEE | |
ELM_SYNDROME_FRAGMENT_4_i (where i = 2) | 0xEC3697FA | |
ELM_SYNDROME_FRAGMENT_5_i (where i = 2) | 0xB86ABCD5 | |
ELM_SYNDROME_FRAGMENT_6_i (where i = 2) | 0x69D9 | |
Set the input syndrome polynomial 3. | ELM_SYNDROME_FRAGMENT_0_i (where i = 3) | 0x0 |
ELM_SYNDROME_FRAGMENT_1_i (where i = 3) | 0x0 | |
ELM_SYNDROME_FRAGMENT_2_i (where i = 3) | 0x0 | |
ELM_SYNDROME_FRAGMENT_3_i (where i = 3) | 0x0 | |
ELM_SYNDROME_FRAGMENT_4_i (where i = 3) | 0x0 | |
ELM_SYNDROME_FRAGMENT_5_i (where i = 3) | 0x0 | |
ELM_SYNDROME_FRAGMENT_6_i (where i = 3) | 0x0 | |
Initiate the computation process for syndrome polynomial 0 | ELM_SYNDROME_FRAGMENT_6_i[16] SYNDROME_VALID (where i = 0) | 0x1 |
Initiate the computation process for syndrome polynomial 1 | ELM_SYNDROME_FRAGMENT_6_i[16] SYNDROME_VALID (where i = 1) | 0x1 |
Initiate the computation process for syndrome polynomial 2 | ELM_SYNDROME_FRAGMENT_6_i[16] SYNDROME_VALID (where i = 2) | 0x1 |
Initiate the computation process for syndrome polynomial 3 | ELM_SYNDROME_FRAGMENT_6_i[16] SYNDROME_VALID (where i = 3) | 0x1 |
Wait until process is complete for syndrome polynomial 0, 1, 2, and 3: Wait until the interrupt is generated or poll the status register. | ||
Wait for page completed interrupt: All error locations are valid. | ELM_IRQSTATUS[8] PAGE_VALID | 0x1 |
Read the process exit status for syndrome polynomial 0: All errors were successfully located. | ELM_LOCATION_STATUS_i[8] ECC_CORRECTABLE (where i = 0) | 0x1 |
Read the process exit status for syndrome polynomial 1: All errors were successfully located. | ELM_LOCATION_STATUS_i[8] ECC_CORRECTABLE (where i = 1) | 0x1 |
Read the process exit status for syndrome polynomial 2: All errors were successfully located. | ELM_LOCATION_STATUS_i[8] ECC_CORRECTABLE (where i = 2) | 0x1 |
Read the process exit status for syndrome polynomial 3: All errors were successfully located. | ELM_LOCATION_STATUS_i[8] ECC_CORRECTABLE (where i = 3) | 0x1 |
Read the number of errors for syndrome polynomial 0: four errors detected. | ELM_LOCATION_STATUS_i[4-0] ECC_NB_ERRORS (where i = 0) | 0x4 |
Read the number of errors for syndrome polynomial 1: two errors detected. | ELM_LOCATION_STATUS_i[4-0] ECC_NB_ERRORS (where i = 1) | 0x2 |
Read the number of errors for syndrome polynomial 2: one error detected. | ELM_LOCATION_STATUS_i[4-0] ECC_NB_ERRORS (where i = 2) | 0x1 |
Read the number of errors for syndrome polynomial 3: no errors detected. | ELM_LOCATION_STATUS_i[4-0] ECC_NB_ERRORS (where i = 3) | 0x0 |
Read the error-location bit addresses for syndrome polynomial 0 of the first four registers: | ELM_ERROR_LOCATION_0_i (where i = 0) | 0x1FE |
ELM_ERROR_LOCATION_1_i (where i = 0) | 0x617 | |
ELM_ERROR_LOCATION_2_i (where i = 0) | 0x650 | |
ELM_ERROR_LOCATION_3_i (where i = 0) | 0xA83 | |
Read the error-location bit addresses for syndrome polynomial 1 of the first two registers: | ELM_ERROR_LOCATION_0_i (where i = 1) | 0x4 |
ELM_ERROR_LOCATION_1_i (where i = 1) | 0x1036 | |
Read the errors location bit addresses for syndrome polynomial 2 of the first registers: | ELM_ERROR_LOCATION_0_i (where i = 1) | 0x3E8 |
Clear the ELM_IRQSTATUS register. | ELM_IRQSTATUS | 0x1FF |