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.

AM1808 nand flash内核区发生位反转,ECC无法校正回去 (急!!!)

Other Parts Discussed in Thread: AM1808

我们公司的一款AM1808产品在正常运行了5个月时候,发生无法启动的情况,uboot输出提示内核crc校验失败,如下:

  1. I2C:   ready
  2. DRAM:  128 MB
  3. NAND:  128 MiB
  4. MMC:   davinci: 0
  5. Bad block table not found for chip 0
  6. Bad block table not found for chip 0
  7. Bad block table written to 0x000007fe0000, version 0x01
  8. Bad block table written to 0x000007fc0000, version 0x01
  9. In:    serial
  10. Out:   serial
  11. Err:   serial
  12. ARM Clock : 372000000 Hz
  13. DDR Clock : 150000000 Hz
  14. Expander @ 0x20 write FAILED!!!
  15. RMII hardware init failed!!!
  16. Net:   Ethernet PHY: GENERIC @ 0x00
  17. Hit any key to stop autoboot:  0
  18. U-Boot > boot
  19. Loading from NAND 128MiB 3,3V 8-bit, offset 0x200000
  20.    Image Name:   Linux-2.6.33-rc4
  21.    Image Type:   ARM Linux Kernel Image (uncompressed)
  22.    Data Size:    1945332 Bytes =  1.9 MB
  23.    Load Address: c0008000
  24.    Entry Point:  c0008000
  25. ## Booting kernel from Legacy Image at c0700000 ...
  26.    Image Name:   Linux-2.6.33-rc4
  27.    Image Type:   ARM Linux Kernel Image (uncompressed)
  28.    Data Size:    1945332 Bytes =  1.9 MB
  29.    Load Address: c0008000
  30.    Entry Point:  c0008000
  31.    Verifying Checksum ... Bad Data CRC
  32. ERROR: can't get kernel image!
  33. U-Boot >

然后我去查看了nand上的内核分区(0x20000开始),发现其中一个bit位发生翻转了,地址再0x2f0520这里,如下:

  1. U-Boot > nand dump 0x2f0000       
  2. Page 002f0000 dump:
  3.         39 bf 4d 1d fd 5f 6d 2b  79 f4 7f 4f 3e bf e6 b7
  4.         a4 49 be bc fe f7 15 db  82 d9 57 66 e9 f6 8d ce
  5.         7b 17 28 b4 33 d4 29 1a  2c bf c1 7a 6d 13 f7 94
  6.         74 84 79 7a df 78 f9 e4  97 e1 f8 28 6f 58 69 f7
  7.         d1 53 d7 c9 ca af 13 ca  e5 b9 8d 60 09 b2 bf 6d
  8.         93 6f fe f8 98 f3 f5 c1  b1 88 67 92 f6 96 5a ee
  9.         a2 72 e2 96 87 dd f5 72  be b1 81 eb 85 b6 87 6e
  10.         .......
  11.         fa 6f 18 2b 37 52 ae 0c  9e c7 3c c6 15 8d e2 3b
  12.         96 bd fe 52 7f b6 93 74  df 57 ae 9a ec 72 e1 c3
  13.         de 67 8c 01 7c 97 c2 77  4e eb d8 f4 5e e2 35 ba
  14.         e5 ba ce a8 23 cb 7c 8d  f3 03 65 d9 c6 76 a7 52
  15.         e2 21 95 ab ae d2 1e 45  ff 05 cb d0 4b d2 4a 1d
  16.         97 63 b9 22 ed 0c 58 b6  a1 71 33 32 f9 f4 6d f6
  17.         a5 f4 cb 69 4f 06 2d d2  db 95 bd d3 2e d5 f4 60

 上面标红色的地方是发生反转的地方,通过对比正常的板子,3c是反转后的值,38是正常的值.

然后我做了一个实验,分别执行了两次nboot.e 0xc0700000 0 0x200000,然后都把ram里对应的数据打印出来,发现了一个奇怪的现象,如下:

第一次执行nboot.e后ram的数据:

  1. U-Boot > nboot.e 0xc0700000 0 0x200000
  2. Loading from NAND 128MiB 3,3V 8-bit, offset 0x200000
  3.    Image Name:   Linux-2.6.33-rc4
  4.    Image Type:   ARM Linux Kernel Image (uncompressed)
  5.    Data Size:    1945332 Bytes =  1.9 MB
  6.    Load Address: c0008000
  7.    Entry Point:  c0008000
  8. U-Boot > md.b 0xc07f0520
  9. c07f0520: fa 6f 18 2b 37 52 ae 0c 9e c7 3c c6 15 8d e2 3b    .o.+7R....<....;
  10. c07f0530: 96 bd fe 52 7f b6 93 74 df 57 ae 9a ec 72 e1 c3    ...R...t.W...r..
  11. c07f0540: de 67 8c 01 7c 97 c2 77 4e eb d8 f4 5e e2 35 ba    .g..|..wN...^.5.
  12. c07f0550: e5 ba ce a8 23 cb 7c 8d f3 03 65 d9 c6 76 a7 52    ....#.|...e..v.R
  13. U-Boot >

第二次执行nboot.e后ram里的数据:

  1. U-Boot > nboot.e 0xc0700000 0 0x200000
  2. Loading from NAND 128MiB 3,3V 8-bit, offset 0x200000
  3.    Image Name:   Linux-2.6.33-rc4
  4.    Image Type:   ARM Linux Kernel Image (uncompressed)
  5.    Data Size:    1945332 Bytes =  1.9 MB
  6.    Load Address: c0008000
  7.    Entry Point:  c0008000
  8. U-Boot > md.b 0xc07f0520             
  9. c07f0520: fa 6f 18 2b 37 52 ae 0c 9e c7 38 c6 15 8d e2 3b    .o.+7R....8....;
  10. c07f0530: 96 bd fe 52 7f b6 93 74 df 57 ae 9a ec 72 e1 c3    ...R...t.W...r..
  11. c07f0540: de 67 8c 01 7c 97 c2 77 4e eb d8 f4 5e e2 35 ba    .g..|..wN...^.5.
  12. c07f0550: e5 ba ce a8 23 cb 7c 8d f3 03 65 d9 c6 76 a7 52    ....#.|...e..v.R
  13. U-Boot >

此时这个发生反转的bit位被校正回来了,那么为什么第一次的时候没有校正,第二次就可以?这个实验每次现象都一样,问题出在了第一次从nand读到ram的时候没有校验成功,第二次在读的时候就可以了,希望TI的达人帮忙分析下原因,谢谢!

目前在用的软件版本:

uboot.2009.11

linux.2.6.33

硬件:

AM1808D4 ,K9F1G08U0D,镁光DDR2