This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

dm8168 CCS 烧录uboot nand flash



通过ccs烧录uboot,发现校验不通过,但是使用其他方式烧录能通过,

使用的nand flash 是三星的kf92g08u0m,

运行bsl中的nand flash测试程序是可以测试通过,能读写正常,但是测试程序中没有ecc校验部分。

Choose your operation 
Enter 1 ---> To Flash an Image
Enter 2 ---> To ERASE the whole NAND 
Enter 3 ---> To EXIT
1
Enter image file path 
F:\u-boot.noxip.bin
Enter offset (in hex): 
0
Choose the ECC scheme from given options :
Enter 1 ---> BCH 8-bit 
Enter 2 ---> HAM  
Enter 3 ---> T0 EXIT
Please enter ECC scheme type :
1
Starting NETRA NAND writer
 
----------------------
  NAND FLASH DETAILS
----------------------
 Device ID : 0xda
 Manufacture ID : 0xec
 Page Size : 2048 Bytes
 Spare Size : 64 Bytes
 Pages_Per_Block : 64
 Number_of_Blocks : 2048
 Device_width : 1 Byte
 DeviceSize : 256 MB
 
 Setting the ECC scheme
  Set the BCH 8 bit ECC scheme  .... done
Preparing to Flash image .... 
Opening image ... done. 
debug_loadAdd=0
Erasing Required Blocks [start = 0, count = 2]...Done
Flashing image ... 
Number of blocks needed for header and data: 0x2
Attempting to start write in block number 0x0.
Writing image data to Block 0 Page0x0
Verify failed. Attempting to clear page
Attempting to start write in block number 0x1.
Writing image data to Block 1 Page0x0
Verify failed. Attempting to clear page
Attempting to start write in block number 0x2.
Writing image data to Block 2 Page0x0
Verify failed. Attempting to clear page
Attempting to start write in block number 0x3.
Writing image data to Block 3 Page0x0
Verify failed. Attempting to clear page
Attempting to start write in block number 0x4.
Writing image data to Block 4 Page0x0
Verify failed. Attempting to clear page
Attempting to start write in block number 0x5.
Writing image data to Block 5 Page0x0
 
 
通过源码调试发现:
Uint32 NETRA_NAND_verifyPage(NETRA_NAND_InfoHandle hNandInfo, Uint32 block, Uint32 page, Uint8* src, Uint8* dest) {
    Uint32 i, errCnt;
    if (NAND_readPage(hNandInfo, block, page, dest) != E_PASS)
        return E_FAIL;
这里出错,直接返回。
同时跟进NAND_readPage这个函数
   
  // Use ECC bytes to correct any errors
        if ((*hNandInfo->hEccInfo->fxnCorrect)(hNandInfo, (block * hNandInfo->pagesPerBlock) + page, spareBytes, &dest[hNandInfo->dataBytesPerOp * i], i) != E_PASS) {
            return E_FAIL;
        }
也即这个指针函数对应的
static Uint32 DEVICE_NAND_ECC_BCH_correct(NETRA_NAND_InfoHandle hNandInfo, Uint32 pageLoc, Uint8 *spareBytes, Uint8 *data, Uint32 opNum) {
    Uint8 syndrome[16];
    Uint32 numerror;
    Uint32 errorloc[8];
    //sapreBytes is of no use therefore used as dump array
 
 
 if (ELM_CheckErrors(&numerror, errorloc, syndrome) != E_PASS) {
        // Error found in data are not fixable
        return E_FAIL;
    }
 
这里失败。