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.

[C6748] ROM Bootloader ECC

Other Parts Discussed in Thread: OMAP-L138

I am using the 'C6748LCDK'  which has a nand flash,  MT29F4G16ABADAH4-IT:D, x16

and using the bootloader of the 'C6748_StarterWare_1_20_04_01' as the user bootloader(UBL)

Many documents say that the C6748 has ECC(4b) hardware of EMAIF and RBL uses the functionality.

I wonder whether the ECC is working.

My board is set for nand boot and was working fine.

But It has been not booting yesterday, so I read the boot block(Block=0, pages=0~32) using the function of the startware and XDS100, as follows,

NandStatus_t NANDPageRead(NandInfo_t *nandInfo,unsigned int blkNum,
                          unsigned int pageNum, volatile unsigned char *rxData,
                          unsigned char *eccData)
{

The result is follows

typedef enum _NAND_STATUS_

{

    NAND_STATUS_PASSED                          =  (0x001),

    NAND_STATUS_FAILED                          =  (0x002),

    NAND_STATUS_NOT_FOUND                       =  (0x004),   

    NAND_STATUS_DEVBUSY                         =  (0x008),

    NAND_STATUS_DEVWRPROTECT                    =  (0x010),

    NAND_STATUS_WAITTIMEOUT                     =  (0x020),

    NAND_STATUS_READWRITE_DMA_FAIL              =  (0x040),

    NAND_STATUS_ECC_UNSUPPORTED                 =  (0x080),

    NAND_STATUS_READ_ECC_ERROR_CORRECTED        =  (0x100),

    NAND_STATUS_READ_ECC_UNCORRECTABLE_ERROR    =  (0x200)

}

 

Reading Blk=1, Page=0. Return Code=0x1

Reading Blk=1, Page=1. Return Code=0x1

Reading Blk=1, Page=2. Return Code=0x1

Reading Blk=1, Page=3. Return Code=0x1

Reading Blk=1, Page=4. Return Code=0x1

Reading Blk=1, Page=5. Return Code=0x1

Reading Blk=1, Page=6. Return Code=0x1

Reading Blk=1, Page=7. Return Code=0x1

Reading Blk=1, Page=8. Return Code=0x1

Reading Blk=1, Page=9. Return Code=0x1

Reading Blk=1, Page=10. Return Code=0x1

Reading Blk=1, Page=11. Return Code=0x1

Reading Blk=1, Page=12. Return Code=0x1

Reading Blk=1, Page=13. Return Code=0x1

Reading Blk=1, Page=14. Return Code=0x1

Reading Blk=1, Page=15. Return Code=0x1

Reading Blk=1, Page=16. Return Code=0x1

Reading Blk=1, Page=17. Return Code=0x1

Reading Blk=1, Page=18. Return Code=0x1

Reading Blk=1, Page=19. Return Code=0x1

Reading Blk=1, Page=20. Return Code=0x1

Reading Blk=1, Page=21. Return Code=0x1

Reading Blk=1, Page=22. Return Code=0x1

Reading Blk=1, Page=23. Return Code=0x1

Reading Blk=1, Page=24. Return Code=0x1

Reading Blk=1, Page=25. Return Code=0x1

Reading Blk=1, Page=26. Return Code=0x100

Reading Blk=1, Page=27. Return Code=0x1

Reading Blk=1, Page=28. Return Code=0x1

Reading Blk=1, Page=29. Return Code=0x1

Reading Blk=1, Page=30. Return Code=0x1

Reading Blk=1, Page=31. Return Code=0x200

Reading Blk=1, Page=32. Return Code=0x200

Bootloader is int page 0~32 and there is an error in Page26.

Page 26 has bit errors but is correctable by RBL ECC hardware

So the booting must be correctly but it isn't.

The C6748's RBL supports ECC?

 

  • Hi Jongheon,
    Yes, RBL supports ECC.


    Reading Blk=1, Page=26. Return Code=0x100

    Reading Blk=1, Page=27. Return Code=0x1

    Reading Blk=1, Page=28. Return Code=0x1

    Reading Blk=1, Page=29. Return Code=0x1

    Reading Blk=1, Page=30. Return Code=0x1

    Reading Blk=1, Page=31. Return Code=0x200

    Reading Blk=1, Page=32. Return Code=0x200

    From this, "0x100" error code means that , this page26 has bit flip error (4bit or below) and corrected, "0x200" error code means that, page31 and 32 has bit flip error ie., more than 4bit which is not correctable by RBL, that's why board is not booting.
  • Thank you Mr. Stalin,

    I rechecked the Boot pages and the boot code is included in pages 0~0x1E(30d) as the following picture which displays the downloading boot code by sfh_OMAP-L138.exe.

     

    So. there is no not-corrected error in pages 0~30 and my board should boot without problems.

    Please let me know other consideration.

  • Hi Jongheon,
    Did you erase the flash before write ?
    Always you have to erase the flash before writing images into NAND flash.
    Then you won't get any confusion like pageno31 and 32 etc.,

    Can you please do this and let me know.
    Able to reproduce your problem ?
  • Thanks Titus S.

    After erasing the flash and read the pages, the return code is 0x200 as follows

    Reading Blk=1, Page=0. Return Code=0x200

    Reading Blk=1, Page=1. Return Code=0x200

    Reading Blk=1, Page=2. Return Code=0x200

    Reading Blk=1, Page=3. Return Code=0x200

    Reading Blk=1, Page=4. Return Code=0x200

    ..

    So It seems to be normal that the return code in reading the erased pagse is 0x200.

    BTW.  Does not the RBL(a part of code to download) erase the pages before writing ones?

    Reproducing my problem: I'will do it.

  • Hi, Titus S.

    I reproduced my problem as follows

    Reading Blk=1, Page=0. Return Code=0x1
    Reading Blk=1, Page=1. Return Code=0x1
    Reading Blk=1, Page=2. Return Code=0x1
    Reading Blk=1, Page=3. Return Code=0x100
    Reading Blk=1, Page=4. Return Code=0x1
    Reading Blk=1, Page=5. Return Code=0x1
    Reading Blk=1, Page=6. Return Code=0x1
    Reading Blk=1, Page=7. Return Code=0x1
    Reading Blk=1, Page=8. Return Code=0x1
    Reading Blk=1, Page=9. Return Code=0x1
    Reading Blk=1, Page=10. Return Code=0x1
    Reading Blk=1, Page=11. Return Code=0x1
    Reading Blk=1, Page=12. Return Code=0x1
    Reading Blk=1, Page=13. Return Code=0x1
    Reading Blk=1, Page=14. Return Code=0x1
    Reading Blk=1, Page=15. Return Code=0x1
    Reading Blk=1, Page=16. Return Code=0x1
    Reading Blk=1, Page=17. Return Code=0x1
    Reading Blk=1, Page=18. Return Code=0x1
    Reading Blk=1, Page=19. Return Code=0x1
    Reading Blk=1, Page=20. Return Code=0x1
    Reading Blk=1, Page=21. Return Code=0x1
    Reading Blk=1, Page=22. Return Code=0x1
    Reading Blk=1, Page=23. Return Code=0x1
    Reading Blk=1, Page=24. Return Code=0x1
    Reading Blk=1, Page=25. Return Code=0x1
    Reading Blk=1, Page=26. Return Code=0x1
    Reading Blk=1, Page=27. Return Code=0x1
    Reading Blk=1, Page=28. Return Code=0x1
    Reading Blk=1, Page=29. Return Code=0x1
    Reading Blk=1, Page=30. Return Code=0x1
    Reading Blk=1, Page=31. Return Code=0x200
    Reading Blk=1, Page=32. Return Code=0x200
    Reading Blk=1, Page=33. Return Code=0x200
    Reading Blk=1, Page=34. Return Code=0x200

    As seen, the block=1, page=3 has correctable error, but my borad does not boot.

  • Hi Mr. Stalin

    Could you please give me any clue or tips about my problem?
  • Hi Stalin,

    I think that C6748 ROM Bootloader ECC has some problems.


    The Application report, www.ti.com/.../spraat2f.pdf, says about the ROM enhancement patch to be applied to the ECC.

    So I patched my bootloader according to 'www.ti.com/.../spraat2' using the following intruction.

    ./HexAIS_OMAP-L138.exe -ini OMAP-L138_ARM_nand_ecc_patch_<platform>.ini -o <boot_image_name>.bin <UserApp_name>.out

    After it done, my board boots fine.
    But there is a problem still.

    When a bit error occurs in block 1, pages 1~63 of the nand flash, the board boots well.
    But when it occurs in Block 1, page 0, the booting fails.
    (I can produce bit errors using XDS100 as you know)

    The ROM is the ROM.
    I think C6748 ROM bootloader could not be changeable whatever do

    So the patch codes are in the block1 page0 of the nand flash.
    If bit errors even 1 bit would occur in the page, the boot will fail

    Am I correct ? Could you tell me more good method?

    Thanks
    Regads.

    Jongheon Park
  • Hi Jongheon,
    Sorry for the delayed response on this.
    Can you please tell the procedure to reproduce your problem in my side ?

    How did you reproduce this and what you have done to get this error ?


    I reproduced my problem as follows

    Reading Blk=1, Page=0. Return Code=0x1
    Reading Blk=1, Page=1. Return Code=0x1
    Reading Blk=1, Page=2. Return Code=0x1
    Reading Blk=1, Page=3. Return Code=0x100
    Reading Blk=1, Page=4. Return Code=0x1
  • Hi Titus,

    How to make errors is

        1.  To download my bootloader into the nand flash Block 2 using sfh_OMAP-L138.exe

        2.  To copy the Block 2 int to Block 1 by runing  the following codes in XDS100

                   

                    src_blkNum = 2;

                    dst_blkNum = 1;    

                     for(pageNum=0; pageNum < 40; pageNum++) {

                            retVal = NANDPageRead(hNandInfo, src_blkNum, pageNum, &rxData[0], &eccData1[0]);

                            retVal = NANDPageWrite1(hNandInfo, dst_blkNum, pageNum, &rxData[0], &eccData1[0]);

                    }

                      ...

                      ..

                      // The function, NANDPageWrite1(), I re-coded NANDPageWrite() in the TI's Startware nadlib.c

                     NandStatus_t NANDPageWrite1(NandInfo_t *nandInfo, unsigned int blkNum,

                              unsigned int pageNum, volatile unsigned char *txData,

                              unsigned char *eccData)

                   {

                             ~

                             ~          

                   

                                NANDPageWriteCmdStart(nandInfo, blkNum, pageNum, columnAddr);

                                if(blkNum==1 && pageNum==1 && flag==1) { // Insert ECC errors

                              eccData[6] ^= 1;                              // If only one bit be corrupt, it is correctable.

                               flag=0;

                             }

                           NANDDataWrite(nandInfo, eccData, (nandInfo->hNandEccInfo->eccByteCnt)*((nandInfo->pageSize)/NAND_BYTES_PER_TRNFS));

                         retVal = NANDPageWriteCmdEnd(nandInfo);

                        ~

                       ~

     

           3.   Reboot the board.

    As seen in codes, I can control the number of error and position

     

    Thanks.

    Regards.

     

    Jongheon Park