天嵌 ARM开发社区

 找回密码
 注册
查看: 2786|回复: 1

裸奔程序RdNF2SDRAM没有做坏块处理,会出错,有做好处理的代码吗?

[复制链接]
vipcff 发表于 2012-8-1 14:41:30 | 显示全部楼层 |阅读模式

-----------------------------
Dnw选择命令9格式化的时候:


Erasing at 0x0 --   0lete.
Erasing at 0xa0000 --   1complete.
Erasing at 0x144000 --   2 complete.
  ........   //ok  字数限制,被我删除
Erasing at 0xd70000 --  21 complete.
Erasing at 0xe14000 --  22 complete.
Erasing at 0xeb8000 --  23 complete.
Erasing at 0xf5c000 --  24 complete.
Erasing at 0xffc000 --  25 complete.
Erasing at 0x10a0000 --  26

NAND 64MiB 3,3V 8-bit: MTD Erase failure: -5


Erasing at 0x1144000 --  27
Erasing at 0x11e8000 --  28
Erasing at 0x128c000 --  29
Erasing at 0x1330000 --  30
Erasing at 0x13d4000 --  31
  ........   //ok  字数限制,被我删除
Erasing at 0x3f5c000 --  99
Erasing at 0x3ffc000 -- 100OK


-----------------------------
Dnw下载20M大小的程序的时候:

Now, Downloading [ADDRESS:30000000h,TOTAL:19955426]

RECEIVED FILE SIZE:19955426 (811KB/S, 24S)


NAND erase: device 0 offset 0x0, size 0x1308000


Erasing at 0x0 --   0lete.
Erasing at 0x30000 --   1complete.
Erasing at 0x60000 --   2complete.
Erasing at 0x90000 --   3complete.
Erasing at 0xc0000 --   4complete.
  ........   //ok  字数限制,被我删除
Erasing at 0xea4000 --  77 complete.
Erasing at 0xed8000 --  78 complete.
Erasing at 0xf08000 --  79 complete.
Erasing at 0xf38000 --  80 complete.
Erasing at 0xf68000 --  81 complete.
Erasing at 0xf98000 --  82 complete.
Erasing at 0xfc8000 --  83 complete.
Erasing at 0xffc000 --  84 complete.
Erasing at 0x102c000 --  85
Erasing at 0x105c000 --  86
Erasing at 0x108c000 --  87
Erasing at 0x10bc000 --  88
Erasing at 0x10f0000 --  89ipping bad block at  0x010f4000                                           


Erasing at 0x1120000 --  90
Erasing at 0x1150000 --  91
Erasing at 0x1180000 --  92
Erasing at 0x11b0000 --  93
Erasing at 0x11e0000 --  94
Erasing at 0x1214000 --  95
Erasing at 0x1244000 --  96
Erasing at 0x1274000 --  97
Erasing at 0x12a4000 --  98
Erasing at 0x12d4000 --  99
Erasing at 0x1304000 -- 100K


NAND write: device 0 offset 0x0, size 0x1308000



Writing data at 0x0 --   0 complete.
Writing data at 0x30a00 --   1
Writing data at 0x61600 --   2
Writing data at 0x92200 --   3
Writing data at 0xc2e00 --   4
........   //ok  字数限制,被我删除
Writing data at 0xe76a00 --  76.
Writing data at 0xea7600 --  77.
Writing data at 0xed8200 --  78.
Writing data at 0xf08e00 --  79.
Writing data at 0xf39800 --  80.
Writing data at 0xf6a400 --  81.
Writing data at 0xf9b000 --  82.
Writing data at 0xfcbc00 --  83.
Writing data at 0xffc600 --  84.
Writing data at 0x102d200 --  85e.
Writing data at 0x105de00 --  86e.
Writing data at 0x108ea00 --  87e.
Writing data at 0x10bf400 --  88e.
Writing data at 0x10f0000 --  89e.
Bad block at 0x10f4000 in erase block from 0x10f4000 will be skipped


Writing data at 0x1124c00 --  90e.
Writing data at 0x1155800 --  91e.
Writing data at 0x1186200 --  92e.
Writing data at 0x11b6e00 --  93e.
Writing data at 0x11e7a00 --  94e.
Writing data at 0x1218600 --  95e.
Writing data at 0x1249000 --  96e.
Writing data at 0x1279c00 --  97e.
Writing data at 0x12aa800 --  98e.
Writing data at 0x12db400 --  99e.
Writing data at 0x130be00 -- 100e.

19955712 bytes written: OK



-----------------------------
所以tq2440的裸奔程序
void RdNF2SDRAM( )
{
        U32 i;
        U32 start_addr = 0x0;
        unsigned char * to = (unsigned char *)0x30000000;
        U32 size = 0x2000000;     //0x100000; 这里被我改成读取20 M
       
         
       
        rNF_Init();
        switch(rNF_ReadID())
        {
                case 0x76:
                        for(i = (start_addr >> 9); size > 0; )
                        {
                                rSB_ReadPage(i, to);
                                size -= 512;
                                to += 512;
                                i ++;
                        }
                        break;
                case 0xf1:
                case 0xda:
                case 0xdc:
                case 0xd3:
                        for(i = (start_addr >> 11); size > 0; )
                        {
                                rLB_ReadPage(i, to);
                                size -= 2048;
                                to += 2048;
                                i ++;
                        }
                        break;
        }
}               
//----运行我的程序出现的现象就是 最后几张图片变形了
我的问题是:
我可以认为是这个RdNF2SDRAM程序确实是因为没有做坏块判断所以会导致出错?
 楼主| vipcff 发表于 2012-8-1 14:42:16 | 显示全部楼层
谢谢各位的讨论
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

i.MX8系列ARM cortex A53 M4 工控板上一条 /1 下一条

Archiver|手机版|小黑屋|天嵌 嵌入式开发社区 ( 粤ICP备11094220号-2 )

GMT+8, 2024-6-9 18:38 , Processed in 1.078125 second(s), 19 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表