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.

批量生产好的机器,断电几天后,开不出,NandFlash启动到booting the kernel.



 设备采用美光的NandFlash 512M大小作为存储介质,生产好一批机器,放在库房
过一段时间拿出来,就有个别机器会开不出来,查看调试信息,发现在启动内核时停滞了:

U-Boot 2011.09 (Jul 16 2015 - 16:09:03)

I2C:   ready
DRAM:  128 MiB
WARNING: Caches not enabled
Could not probe the EEPROM; something fundamentally wrong on the I2C bus.
NAND:  HW ECC Hamming Code selected
256 MiB
MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
Error: Bad compare! failed
Error: Bad compare! failed
Error: Bad compare! failed
NAND read from offset 260000 failed -74
*** Warning - readenv() failed, using default environment

Net:   cpsw
Hit any key to stop autoboot:  0
Card did not respond to voltage select!
Booting from nand ...
HW ECC BCH8 Selected

NAND read: device 0 offset 0x280000, size 0x360000
 3538944 bytes read: OK
## Booting kernel from Legacy Image at 80007fc0 ...
   Image Name:   Linux-3.2.0
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3328824 Bytes = 3.2 MiB
   Load Address: 80008000
   Entry Point:  80008000
   XIP Kernel Image ... OK
OK

Starting kernel ...

Uncompressing Linux... done, booting the kernel.    停在这里了

问题:
(1) 为什么是小部分机器
(2) 停在这里代表什么意思
(3) 将nand的存放uImage的部分数据读出,对比,数据好像也是对的

求助啊!!!!!!

  • 想确认一下, 你的DDR用的是DDR3吗?有没有做过EMIF PHY的配置,还有就是DDR3 software leveling?

    根据以往的经验,在DDR3没有做以上完整的流程的时候,出现过概率性事件,在booting the kernel后挂掉的,主要原因是这里的DDR的压力比较大,在时序配置不完善的时候,较为容易挂掉.所以先检查DDR配置先.

  • 感谢您细致的回复。

    请问,“所以先检查DDR配置先”,  是在哪里配置, uboot代码, linux设备驱动代码,还是配置内核选项?

    我们使用TI的cortexA8,  am335x的linux源码开发包am335x-evm-sdk-src-05.06.00.00来二次开发的。

  • 您这个sdk太老了,如果您不熟悉device tree,可以参考 http://software-dl.ti.com/sitara_linux/esd/AM335xSDK/06_00_00_00/index_FDS.html 或者用我们最新的sdk即可。 ddr的配置在uboot中,可以参考下面的链接:

    1. http://processors.wiki.ti.com/index.php/AM335x_DDR_PHY_register_configuration_for_DDR3_using_Software_Leveling 

    2. http://processors.wiki.ti.com/index.php/AM335x_EMIF_Configuration_tips 

    在论坛里多搜搜,相关的文章很多

  • 我们用的是DDR2  也要做相关配置吗?

  • ddr2 不需要做software leveling,其他还是要配置的。

  • 感觉还是和内存有关系

  • 谢谢:

           经过对比分析,发现NandFlash 中的uboot-img存放区的数据发生变化了.

          我首先想到的是对flash 进行写保护。

          可以我发现我的uboot命令行下,不支持protect命令,  看网上网友介绍的资料,都是用flinfo 和protect命令来对nandflash做写保护的。

          那么,请问如何扩展uboot下的命令呢?

  • ti的 uboot是标准的uboot,扩展uboot 命令的方式遵照标准的做法即可。

    这里,我另外建议您看看nand flash的时序,我有客户遇到过类似的问题,据他说是优化了nand flash 时序搞定的。

  • 谢谢您的回复,是我继续下去的动力。

    一种办法,我继续想办法让uboot支持nand的写保护操作。

    在include/configs/am335x_evm.h中,去掉以下宏定义,应该可以打开对应的写保护功能。
      - - /* #define CONFIG_SYS_NO_FLASH */

    因为,在include/config_cmd_default.h 关联宏定义
    #ifndef CONFIG_SYS_NO_FLASH
    #define CONFIG_CMD_FLASH /* flinfo, erase, protect */
    #define CONFIG_CMD_IMLS  /* List all found images */
    #endif

    但是,编译不通过,TI发布的UBOOT代码没有对该部分功能支持到位。

    arch/arm/lib/libarm.o: In function `board_init_r':
    /home/wangxj/ti-sdk-am335x-evm/u-boot-2011.09-psp04.06.00.07/arch/arm/lib/board.c:482: undefined reference to `flash_init'
    common/libcommon.o: In function `do_imls':
    /home/wangxj/ti-sdk-am335x-evm/u-boot-2011.09-psp04.06.00.07/common/cmd_bootm.c:1213: undefined reference to `flash_info'
    /home/wangxj/ti-sdk-am335x-evm/u-boot-2011.09-psp04.06.00.07/common/cmd_bootm.c:1213: undefined reference to `flash_info'
    common/libcommon.o: In function `flash_sect_roundb':
    /home/wangxj/ti-sdk-am335x-evm/u-boot-2011.09-psp04.06.00.07/common/cmd_flash.c:148: undefined reference to `flash_info'
    common/libcommon.o: In function `flash_fill_sect_ranges':
    /home/wangxj/ti-sdk-am335x-evm/u-boot-2011.09-psp04.06.00.07/common/cmd_flash.c:289: undefined reference to `flash_info'
    common/libcommon.o: In function `flash_sect_protect':
    /home/wangxj/ti-sdk-am335x-evm/u-boot-2011.09-psp04.06.00.07/common/cmd_flash.c:679: undefined reference to `flash_info'
    common/libcommon.o:/home/wangxj/ti-sdk-am335x-evm/u-boot-2011.09-psp04.06.00.07/common/cmd_flash.c:679: more undefined

    references to `flash_info' follow
    common/libcommon.o: In function `flash_sect_erase':

     

    第二种办法: 按你说的,朝NAND的时序控制上来研究。

        但是,真的感觉不现实,我们基本都是靠近应用层的工程师,要去玩这么底层的驱动,感觉难度太大了。
        请问,能否告诉我您那个客户的联系方式吗,我和他请教沟通一下,看是否问题现象一样?