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.

C6655更换NANDFLASH型号bootload启动不了

Other Parts Discussed in Thread: TMS320C6655

各位工程师:

你好,

我之前用的EVM板参考的NANDFLASH,型号是MT29F1G08AACWP,用官方提供的C6657nandflash bootloader来烧写存入NANDFLASH的程序,我的6655是可以正确boot的。

由于MT29F1G08AACWP这个NANDFLASH停产了,我们现在更换了NANDFLASH的型号,现在选用MT29F4G08ABBFAH4-IT_F这个型号的NANDFLASH。这两个nandflash的主要区别就是存储区大小不一致,如下面两图(第一幅是EVM板上使用的NANDFLASH):

现在我都用C6657nandflash bootloader来烧写同样的程序,原本对于nandflash的配置是如下所示:

unsigned int busWidth             = 8;
unsigned int pageSizeBytes        = 2048;
unsigned int pagesPerBlock        = 64;
unsigned int spareBytesPerSegment = 16;
unsigned int spareBytesPerPage    = 0;

现在我改为了如下:

unsigned int busWidth             = 8;
unsigned int pageSizeBytes        = 4096;
unsigned int pagesPerBlock        = 64;
unsigned int spareBytesPerSegment = 64;
unsigned int spareBytesPerPage    = 0;

能用C6657nandflash bootloader来对nandflash进行正确读写,但是写入后不能正确启动,用FPGA抓取可以看到,DSP上电后一直在读取nandflash的数据,但是读取的nandflash的地址不在正常范围内。

我想知道这个会是什么原因啊?这个问题要怎么解决啊,麻烦各位了。感谢。

  • 第一幅图片是新的nandflash的,上面写错了
  • 第一幅图片是新的nandflash的,上面写错了
  • 请问你是通过IBL的方式来实现nand启动的?还是直接nand启动的?
  • 看一下替换的nand flash 是否是ROM bootloader支持的。
    For non-ONFI NANDs, the RBL can boot only from devices whose NAND geometry can be determined either from matching manufacturer/device ID with values in a pre-determined look up table or if the RBL can determine the geometry from the 4th ID byte on the NAND.
  • 这个在哪里看呀?怎么看啊?
  • 我看了一下,替换的nandflash是ROM bootloader支持的,通道读ID指令读取地址0x00可以读到具体的geometry ,读0x20也可以读到ONFI这四个字节
  • 仿真器跟一下看看有没有进入用户代码,还是仍然在RBL中。
  • 另外新的flash是否需要4位ECC校正?
    包括C665x在内的Keystone器件受勘误表中的Advisory 20提供的问题的影响。
    www.ti.com/.../sprz370e.pdf
  • 用户代码是指什么?我的PC指针指向0x20B044F4这种位置,然后抓到了EMIF的一直在读取nandflash,这应该是还在RBL中吧。

    我这可以看到DSP就一直在发nandflash的读page指令啊(0x00 - 0x30),就是地址不太对,正常我当时写入的nandflash里面的程序只占了4个block的地址空间,但是这里已经读到很后面去了(读写的地址如下图),所以读出来都是0xFF。

  • 新的flash写的是ECC bits是8bit,但evm参考板用的那个flash的ECC bit是1bit。这个是不行嘛?我看C6657nandflash bootloader里面的代码,通过emif的几个寄存器读取出来的ecc值组合后写入spare空间内,我不太理解nandflash的ECC bits位是用来干嘛的
  • tms320c6655可以支持最高4位ECC。
    如果使用8bit ECC校验有可能会引起启动失败。
    processors.wiki.ti.com/.../Raw_NAND_ECC
    另外,无法正确读取内容,可能还需要仔细检查两个NAND设备之间的其他差异(指令集,时序等)。
  • 我用的同一个公司的NANDFLASH啊,指令集时序我检查过了都是一样的。

    另外我用官方提供的C6657nandflash bootloader来烧写的代码,这个里面就用的4bit的ECC校验,我也去重新看了一遍RBL的代码,那个里面也是按4bit ECC校验来读取spare空间的ECC的,就都是每512个字节的数据对应16个spare area来写入ECC数据,这应该是也是没错的呀。
    就算nandflahs手册上写8bit ECC,也应该只是spare area空间更大才对吧?我这么理解没问题吧?

    我现在用的nandflash是一个page有4096个字节的数据空间和256字节的spare area,按RBL的就是分成8个512个字节来读写,每个512字节需要16个字节的spare area,我总共用到了8*16 = 128个字节的spare area,后面的128个字节的spare area我就没有操作,也没去管过。应该没问题吧?

    但是我的就是boot不起来,我看抓出来的nandflash的数据线一直在读取其他的block,我感觉像是卡在了RBL的读page出来后的那个校验那里,就是RBL的以下这段代码:感觉是那个ret != NAND_RET_OK那个if里面
    do
    {
    // Read a page (includes bad block checking and correcting page data using ECC
    ret = hwNandReadPage(hNandInfo, currentBlock, currentPage);
    // Was the page read successful? If not, skip to the next block and try again.
    if (ret != NAND_RET_OK)
    {
    // Skip to the next block
    currentBlock = currentBlock + 1;
    // Start with first page on the new block
    currentPage = 0;
    // Stay in the read data loop when starting on a new block
    moreData = TRUE;
    }
    else
    {
    // Pass the data to the boot processing function.
    // It will return TRUE if more data is needed.
    moreData = bootDataProcess (nandBootData, hNandInfo->dataBytesPerPage, (UINT32 *)nandBootDataTypes, TRUE);

    // Is there more of the boot image to read from the NAND flash?
    if (moreData == TRUE)
    {
    // Update page pointer for this block
    currentPage = currentPage + 1;

    // Does this block have another page to read?
    if (currentPage >= hNandInfo->pagesPerBlock)
    {
    // Ran out of pages on this block, start reading from the next
    bootLogEntry ((char *)fname, __LINE__, (SINT32)NAND_BOOT_IMAGE_ON_MULTIPLE_BLOCKS);

    // Skip to the next block
    currentBlock = currentBlock + 1;

    // Start with first page on the new block
    currentPage = 0;
    }
    }
    }
    } while (moreData == TRUE);

    我想知道一下对于这个RBL怎么用仿真器跟踪啊?我在另外一个问题里面找到一个人的回复说看一下网页的内容:processors.wiki.ti.com/.../Debugging_Boot_Issues 但是里面只有讲load symblol啊,我想知道如果是RBL,我是用load symbol跟踪嘛? 那我这个symbol选择哪个文件呀?
  • 一般load symbol的文件就是相应的.out文件。官网提供的只是源文件,无法直接仿真器跟踪。
  • 请问你说的用官方提供的C6657nandflash bootloader来烧写的代码,这个里面就用的4bit的ECC校验是指哪部分代码?我需要再跟相关工程师确认一下ECC校验位的问题。