Jffs2_scan_eraseblock (): Magic and Empty Flash... Solution!

Source: Internet
Author: User

During this time, due to work needs, we have been working on the JFFS2 root file system in Linux. In the early stage, Empty flash at 0x0012cdff-0x0012ffff and jffs2_scan_eraseblock (): Magic ..... although such a large number of warnings do not affect the running of the linux system, it is not very safe for the linux system. After all, the address that should not be erased is always erased, because these locations correspond to the linux kernel code, and they do not always feel perfect solutions to the problem. Therefore, on the internet, GOOGLE also found that many people have encountered such problems, many people have also written solutions to this problem. However, according to the methods on the Internet, this problem cannot be solved. Later, there was no solution, the problem can be solved only after you have carefully read the MTD details and analyzed the relevant code, and finally modified the two parts.

Let's talk about the preparation of the JFFS2 file system and some details: mkfs. jffs2

In the Development Board, use cat proc/mtd to check whether the erasesize is 0x10000. When I create a JFFS file, I also select 0x10000. Therefore, it is not a problem here. Finally, I checked that the size of the JFFS2 file generated is 1.200 mb. I was wondering how strange the file size is. Finally, I figured it out myself: 1.2x1024x1024 = 1258291.2 = 0x133333. When I regenerate the JFFS2 file, I set -- pad = 0x133333, check the JFFS2 file size and ask 1.218 MB. Different. This indicates that it is likely that the dirty data in the memory is filled into the remaining page of the file system. Jffs2_scan_eraseblock ():
Magic and Empty Flash at... problems, then burned into the system, started very quickly, no longer see these two errors. The problem is solved perfectly.

Mkfs. jffs2-n-s 512-e 64KiB-- Pad = 0x133333-D
Rootfs-o myjffs2.img
Parameter notes:
-S page size, which can be set by default.
-E: the size of the erased Block. It must match the size of the Block in the manual. The size is 128 (as can be seen in the manual) and 1 Block = (2 K + 64) B + 64 Pages = (128 K + 4 K) bytes
If the value is too large (for example, 256), The jffs2_scan_eraseblock (): Magic bitmask ...... problem occurs.
If the setting is too small (such as 64), the problem of Empth flash ......
-- Pad sets the size of the generated file, which is not set here, because this option indicates filling. When the size of the generated file is larger than the size specified by the parameter, this option does not work only when the size of the generated file is smaller than the specified size. If the size of the generated file is not standard, dirty memory data may be filled into the remaining page of the file system.

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.