Nand Flash Yaffs系统大量写入数据失败问题的解决方法。
2010-07-16 12:59
1221 查看
一个朋友的问题,我们共同分析后搞定。其实以前也遇到过同样问题,时间长了,没总结。
事发:在Nand Flash上使用2.6.14的linux kernel,三星2440的板子,连续写入文件,到一定大小限制就删除,文件写入没有超过flash保留10%的空闲,应该说还差很多。
第一步,不适用syslog写,换做自己写代码写入,出现几率降低;
第二步,fwrite换成write,几率增加,很快就坏。
坏的时候提示:yaffs tragedy: no more eraased blocks !!!!!!!!! Allocator out !!!!!!!!!!!!!!!!!
重新启动,就会标出很多坏块(bad block...),当然是假的,一格式化,就好。
第三步,朋友说用2.6.34的内核,没有问题,但从14移到34,需要修改的驱动之类太多,数据结构变化太大。
第四步,我想起以前说起nand时候mtd校验和yaffs校验不能同时开启。
第五步,让在14内核上关闭yaffs软校验,开启mtd nand硬件校验,出现:mtd ecc error unfixed on chunk 26784
第六步,14内核,关闭mtd nand硬件校验,使用yaffs软校验,出现: VFS: Mounted root (cramfs filesystem) readonly. Mounted devfs on /dev Freeing init memory: 108K Error -3 while decompressing! c02ccb50(312)->c3cc0000(4096) Failed to execute /linuxrc. Attempting defaults... Kernel panic - not syncing: No init found. Try passing init= option to kernel.
然后,想了想。
34可以,14同样的配置不可以,应该是软件差异。查看14下yaffs的版本,挺老。朋友说34下的yaffs拿过去编译无法通过。
我从这边使用的18内核抠出来yaffs部分给他,这个yaffs是:
Id: yaffs_mtdif.c,v 1.22 2009/03/06 17:20:51 wookey Exp $";
编译,还是有一个头文件(linux/uaccess.h)找不到,屏蔽之,OK。
再编译,使用mtd的硬nand ecc,关闭yaffs own ecc,测试,OK,写文件OK,写入断电 OK。
总结:主要就是两种ECC冲突的事情,yaffs官网上写道:
Nand interface: For yaffs to function, it must be able to be the only code that writes to the oob area on the NAND device. The existing NAND driver in kernel 2.4.19 assumes that it will do the ecc/oob management for the host fs. For yaffs, this is quite wrong. You can disable ecc/oob calculations either by hand patching the mtd code to bypass ecc calculations or by merging the latest mtd cvs.
当然这针对2.4的内核,莫非2.6也涛声依旧?
事发:在Nand Flash上使用2.6.14的linux kernel,三星2440的板子,连续写入文件,到一定大小限制就删除,文件写入没有超过flash保留10%的空闲,应该说还差很多。
第一步,不适用syslog写,换做自己写代码写入,出现几率降低;
第二步,fwrite换成write,几率增加,很快就坏。
坏的时候提示:yaffs tragedy: no more eraased blocks !!!!!!!!! Allocator out !!!!!!!!!!!!!!!!!
重新启动,就会标出很多坏块(bad block...),当然是假的,一格式化,就好。
第三步,朋友说用2.6.34的内核,没有问题,但从14移到34,需要修改的驱动之类太多,数据结构变化太大。
第四步,我想起以前说起nand时候mtd校验和yaffs校验不能同时开启。
第五步,让在14内核上关闭yaffs软校验,开启mtd nand硬件校验,出现:mtd ecc error unfixed on chunk 26784
第六步,14内核,关闭mtd nand硬件校验,使用yaffs软校验,出现: VFS: Mounted root (cramfs filesystem) readonly. Mounted devfs on /dev Freeing init memory: 108K Error -3 while decompressing! c02ccb50(312)->c3cc0000(4096) Failed to execute /linuxrc. Attempting defaults... Kernel panic - not syncing: No init found. Try passing init= option to kernel.
然后,想了想。
34可以,14同样的配置不可以,应该是软件差异。查看14下yaffs的版本,挺老。朋友说34下的yaffs拿过去编译无法通过。
我从这边使用的18内核抠出来yaffs部分给他,这个yaffs是:
Id: yaffs_mtdif.c,v 1.22 2009/03/06 17:20:51 wookey Exp $";
编译,还是有一个头文件(linux/uaccess.h)找不到,屏蔽之,OK。
再编译,使用mtd的硬nand ecc,关闭yaffs own ecc,测试,OK,写文件OK,写入断电 OK。
总结:主要就是两种ECC冲突的事情,yaffs官网上写道:
Nand interface: For yaffs to function, it must be able to be the only code that writes to the oob area on the NAND device. The existing NAND driver in kernel 2.4.19 assumes that it will do the ecc/oob management for the host fs. For yaffs, this is quite wrong. You can disable ecc/oob calculations either by hand patching the mtd code to bypass ecc calculations or by merging the latest mtd cvs.
当然这针对2.4的内核,莫非2.6也涛声依旧?
相关文章推荐
- Nand Flash Yaffs系统大量写入数据失败问题的解决方法。
- 解决横纵屏问题、得到系统通讯录数据的方法
- 解决HBase Replication在数据大量写入时导致RegionServer崩溃问题
- 关于easyui datagrid 大量数据加载时 出现假死问题的解决方法
- 通用权限管理系统组件回答用户的常用问题:操作权限、用户角色、数据权限的解决方法
- php post大量数据时发现数据丢失问题解决方法
- php post大量数据时发现数据丢失问题解决方法
- Mysql5.5 大量数据插入出现的抖动问题 及 解决方法
- 关于管道的大量数据传输问题解决方法 ( vc )
- java读写properties文件,解决系统找不到指定路径,解决写入后读取正常,但文件数据未更新问题
- SVN提交数据(Commit)失败问题(MKACTIVITY ... 403 Forbidden)解决方法
- SVN提交数据(Commit)失败问题(MKACTIVITY ... 403 Forbidden)解决方法
- 有关Ossim 4.8系统首次登陆设置密码失败问题的解决方法
- 织梦上传服务器后数据连接失败问题的解决方法
- 快速解决安卓7.0系统写入SD卡权限失败的问题
- WF 自定义活动开发常见问题(进入第二个流程状态,数据传递失败的解决方法)
- 解决安卓7.0系统写入SD卡权限失败问题
- 关于EXP-00056: 遇到 ORACLE 错误 1455 ORA-01455: 转换列溢出整数数据类型 EXP-00000: 导出终止失败 的问题解决方法整理
- 解决HBase在数据大量写入时导致RegionServer崩溃问题
- swift数据持久化之属性列表,解决plist写入失败的问题