nand read ERROR failed -74

在海思芯片的uboot下想修改为NAND_ECC_SOFT

进行nand scrub

输入nand write 0xc1500000 0 0x200000

然后输入nand read 0xc1500000 0 0x200000

结果出现nand write 0xc1500000 0 0x200000

通过分析知道ecc_layout的问题

修改hinand.c中的hinand_oob_64_1bit为:

#if 0
static struct nand_ecclayout hinand_oob_64_1bit =
{
 .eccbytes    = 20,
 .eccpos      = {
  11, 12, 13, 14, 15,
  27, 28, 29, 30, 31,
  43, 44, 45, 46, 47,
  59, 60, 61, 62, 63
 },
 .oobfree = {{2, 9}, {16, 11}, {32, 11}, {48, 11}}
};
#else
static struct nand_ecclayout hinand_oob_64_1bit =
{
    .eccbytes = 24,
    .eccpos = {
               40, 41, 42, 43, 44, 45, 46, 47,
               48, 49, 50, 51, 52, 53, 54, 55,
               56, 57, 58, 59, 60, 61, 62, 63},
    .oobfree = {
            {.offset = 2,
             .length = 38}}

};

#endif

然后nand read ok。百思不得其解,于是跟踪代码,在nand_scan_tail中有这样一段代码

case NAND_ECC_SOFT:
  chip->ecc.calculate = nand_calculate_ecc;
  chip->ecc.correct = nand_correct_data;
  chip->ecc.read_page = nand_read_page_swecc;
  chip->ecc.write_page = nand_write_page_swecc;
  chip->ecc.read_oob = nand_read_oob_std;
  chip->ecc.write_oob = nand_write_oob_std;
  chip->ecc.size = 256;
  chip->ecc.bytes = 3;
  break;

其中ecc.bytes = 3, 这样我们2k的flash就需要ecclayout中的eccbytes 至少应该大于 3×8 =24字节。

这样也就解释了为什么原来的ecc_layout下nand read failed的问题。

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
NAND flash memory is widely used in electronic devices such as smartphones, tablets, and solid-state drives (SSDs). During the reading process, errors can occur due to various factors such as noise and interference. To improve the reliability of data reading, NAND flash memory controllers implement two techniques: re-read and read retry. Re-read is a technique where the memory controller reads the same data multiple times and compares the results to detect errors. If the results are inconsistent, the controller will perform another read operation until it gets a consistent result. Re-read is a simple and effective technique to detect and correct errors. Read retry is a more advanced technique that involves adjusting the read parameters of the memory controller based on the characteristics of the NAND flash memory. Read parameters such as read voltage and read latency can be adjusted to improve the reliability of data reading. Read retry requires more complex algorithms and can improve the performance of the NAND flash memory in high-noise environments. In summary, re-read and read retry are two techniques used by NAND flash memory controllers to improve the reliability of data reading. Re-read is a simple and effective technique that reads the same data multiple times and compares the results to detect errors. Read retry is a more advanced technique that adjusts the read parameters of the memory controller based on the characteristics of the NAND flash memory to improve the reliability of data reading.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值