Solution to the failure of writing a large amount of data to the NAND Flash yaffs system.

Source: Internet
Author: User

A friend's problem can be solved after analysis. In fact, I have encountered the same problem before. It takes a long time and I have not summarized it.

 

Incident: Linux kernel 2.6.14 is used on NAND Flash, and the Samsung 2440 board is used to continuously write files and delete the files to a certain size limit. The number of idle Files written to flash is not more than 10%, it should be said that there are still many differences.

 

Step 1: syslog writing is not applicable. If you write your own code, the probability of writing is reduced;

Step 2: replace fwrite with write, and the probability increases, which will soon break down.

 

When the error occurs, the following message is displayed: yaffs tragedy: No more eraased blocks !!!!!!!!! Allocator out !!!!!!!!!!!!!!!!!

 

When you restart the service, a lot of bad blocks (Bad blocks...) will be marked. Of course, they are fake. Just format them.

 

Step 3, a friend said that using the 2.6.34 kernel is okay, but from 14 to 34, there are too many drivers to be modified, and the data structure has changed too much.

Step 4: I think that MTD checksum and yaffs checksum cannot be enabled at the same time in NAND.

Step 5: Disable the yaffs soft check on the 14 kernel and enable the mtd nand hardware check. The following error occurs: mtd ecc error unfixed on chunk 26784.

Step 6: 14 kernel, disable mtd nand hardware verification, and use yaffs soft verification. The following error occurs: VFS: mounted root (cramfs filesystem) readonly. mounted devfs on/dev freeing init memory: 108 k 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.

Then, I thought about it.

34. 14. The same configuration is not allowed. It should be software difference. View the version of yaffs under 14, which is quite old. My friend said that the compilation of the yaffs under 34 failed.

I used the 18 kernel here to pull out the yaffs part for him. The yaffs is:

ID: yaffs_mtdif.c, V 1.22 2009/03/06 17:20:51 wookey exp $ ";

Compile, there is still a header file (Linux/uaccess. h) not found, block it, OK.

Compile again, use hard nand ecc of MTD, disable yaffs own ECC, test, OK, Write File OK, write power failure OK.

Conclusion: There are two main ECC conflicts, which were written on the official website of 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.

Of course, this is for the 2.4 kernel. Is it still true?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.