最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[已解决]yaffs2: Block XXX needs retiring

工作和技术 crifan 3306浏览 0评论

【问题】

下载了yaffs2源码后,运行patch-ker.sh,拷贝源码到kernel的source里面,然后去

make ARCH=arm menuconfig,后选上 File System -> Misc File System -> Yaffs2

之后,默认配置即可,注意,一般来说,不要选这个:

"Lets Yaffs do its own ECC ",这样,让上层MTD,底层你的nand驱动去处理ECC的事情。

然后就可以去编译了:

make ARCH=arm uImage

然后编译一切顺利。

但是,最后将uImage 和rootfs烧写到nand里面去,启动kernel后,去mount yaffs2的rootfs,

虽然可以mount成功,但是,无法正常使用yaffs2,显示错误:

**>> Block 285 needs retiring
。。

**>> yaffs write required 321 attempts
**>> Block 285 retired
Block 285 is in state 9 after gc, should be erased
**>> Block 606 needs retiring

**>> yaffs write required 321 attempts
yaffs tragedy: no space during cache write
**>> Block 287 retired
Block 287 is in state 9 after gc, should be erased
**>> Block 1248 needs retiring

。。。

**>> Block 1599 needs retiring
**>> Block 1600 needs retiring
yaffs tragedy: no more erased blocks
!!!!!!!!! Allocator out !!!!!!!!!!!!!!!!!
**>> yaffs write required 31 attempts
#
**>> Block 289 retired
Block 289 is in state 9 after gc, should be erased
**>> Block 290 retired
Block 290 is in state 9 after gc, should be erased
yaffs tragedy: no more erased blocks
!!!!!!!!! Allocator out !!!!!!!!!!!!!!!!!

【解决办法】

1.已经去验证过了,nand驱动的数据读写,是对的,排除nand驱动读写错误。

2.http://topic.csdn.net/u/20080710/10/019d927b-01dc-4193-8e31-3ce13552edc5.html?887139192

中提到的,可能的原因:

A。如果选上"Lets Yaffs do its own ECC ",可能会有问题。

B。“是交叉编译器的问题,至少我用arm-linux-gcc编出来的版本可以正常使用,arm-linux-uclibc-gcc编出来的版本就有上面的问题”

A。我的未选上,没这个问题。

B。我的是用的arm-linux-uclibc-gcc。其他的,有待验证。

接下来,想办法验证yaffs2的工作是否正常。

最后,验证了是nand flash驱动的write_buf有问题,导致没有将数据写入nand,然后在yaffs2中的先write,再verify,就出错了,所以,会出现上面的warning。

详情参考:【经验与教训】从Uboot中移植已经work的nand flash驱动到Kernel中,始终工作不正常

转载请注明:在路上 » [已解决]yaffs2: Block XXX needs retiring

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
79 queries in 0.154 seconds, using 22.11MB memory