Hi.
We are producing network camera with dm368
Sometimes NAND boot failed is occured!!
serail log as followings
------------------------------------------------------
DM36x initialization passed!
TI UBL Version: 1.50
Booting Catalog Boot Loader
BootMode = NAND
Starting NAND Copy...
Valid magicnum, 0xA1ACED66, found in block 0x00000008.
No valid boot image found!
NAND Boot failed.
Aborting...
-----------------------------------------------------
flashutil version : flash_utils_dm36x_1.1.0 ( IPNC RDK 2.6 )
nandflash : MT29F1G08ABAEAH4
I insert debug code to ubl and I found 1 bit error in uboot region
The UBL code detect ecc error and try to correct but
ecc_state return number 5 in NADFSR and return ERROR;
so print NAND Boot fialed.
following is device_nand.c in UBL
static Uint32 DEVICE_NAND_ECC_correct(NAND_InfoHandle hNandInfo, Uint8 *data, Uint8 *readECC)
{
VUint32 temp, corrState, numE;
Uint32 i;
Uint16 addOffset, corrValue;
Uint16* syndrome10 = (Uint16 *)readECC;
// Clear bit13 of NANDFCR
temp = AEMIF->NANDERRADD1;
// Load the syndrome10 (from 7 to 0) values
for(i=8;i>0;i--)
{
AEMIF->NAND4BITECCLOAD = (syndrome10[i-1] & 0x000003FF);
}
// Read the EMIF status and version (dummy call)
temp = AEMIF->ERCSR;
// Check if error is detected
temp = (AEMIF->NAND4BITECC1 & 0x03FF03FF) | (AEMIF->NAND4BITECC2 & 0x03FF03FF) |
(AEMIF->NAND4BITECC3 & 0x03FF03FF) | (AEMIF->NAND4BITECC4 & 0x03FF03FF);
if(temp == 0)
{
return E_PASS;
}
// Start calcuating the correction addresses and values
AEMIF->NANDFCR |= (0x1U << DEVICE_EMIF_NANFCR_4BITECC_ADD_CALC_START_SHIFT);
// Loop until timeout or the ECC calculations are complete (bit 11:10 == 00b)
i = NAND_TIMEOUT;
do
{
temp = (AEMIF->NANDFSR & DEVICE_EMIF_NANDFSR_ECC_STATE_MASK)>>10;
i--;
}
while((i>0) && (temp != 0x0));
// Read final correction state (should be 0x0, 0x1, 0x2, or 0x3)
corrState = (AEMIF->NANDFSR & DEVICE_EMIF_NANDFSR_ECC_STATE_MASK) >> DEVICE_EMIF_NANDFSR_ECC_STATE_SHIFT;
if ((corrState == 1) || (corrState > 3))
{
return E_FAIL; <== corrState is 5 so return error
}
else if (corrState == 0)
{
return E_PASS;
}
else
ECC_STATE meanning is following in EMIF User Guide
1-8 ECC_STATE ECC correction state while performing 4-bit ECC Address and Error Value Calculation
0h No errors detected
1h Errors cannot be corrected (5 or more)
2h Error correction complete
3h Error correction complete
4h Reserved
5h Calculating number of errors
6h - 7h Preparing for error search
8h Searching for errors
9h - Bh Reserved
Ch - Fh Calculating error value
What's the detailed meanning of the ECC_STATE
and Why ECC_STATE is set to 5
and How can I Fix this problem?