第一次挂载jffs2文件系统,出现:Node header CRC failed at

合集下载
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

第一次挂载jffs2文件系统,出现:Node header CRC failed at
使用的bootloader:redboot
kernel版本:2.6.29
flash类型:NOR FLASH.
制作jffs2的命令:
mkfs.jffs2 -U -d /mnt/winF/tet/romfs -D devtable.jffs2.txt -l -e 0x10000 -p -n -o /tftpboot/jffs2fs.img
"-e":表示flash的擦除块大小为0x10000,这个值很重要,可以从datasheet中得到。

"-p":
Pad output to SIZE bytes with 0xFF. If SIZE is not specified, the output is padded to the end of the final erase block.
烧写命令:
load -r -v -h 172.21.73.101 -b 0x8000 kernel.lzo
fis create -b 0x8000 -l 0x200000 -s 0x200000 -f 0x7F060000 -e 0x8000 kernel.lzo
load -r -v -h 172.21.73.101 -b 0x100000 jffs2fs.img
fis write -b 0x100000 -f 0x7F260000 -l 0x250000
fis create -f 0x7F260000 -l 0x590000 jffs2.img
reset
问题描述:
第一次启动,会出现CRC错误信息,如下:
Shell invoked to run file: /etc/rc
Welcome to
____ _ _
/ __| ||_|
_ _| | | | _ ____ _ _ _ _
| | | | | | || | _ \| | | |\ \/ /
| |_| | |__| || | | | | |_| |/ \
| ___\____|_||_|_| |_|\____|\_/\_/
| |
|_| ADVANTECH eAutomation
For further information check:
/
/eAutomation/
Execution Finished, Exiting
Sash command shell (version 1.1.1)
/> JFFS2 notice: (164) jffs2_get_inode_nodes: Node header CRC failed at 0x06ddc8.
{ff5c,ff5c,ff5cff5c,6cedd300}
JFFS2 notice: (164) jffs2_get_inode_nodes: Node header CRC failed at 0x06c8c4. {ff5c,ff5c,ff5cff5c,ff5cff5c}
JFFS2 notice: (164) jffs2_get_inode_nodes: Node header CRC failed at 0x06b3c0. {ff5c,ff5c,ff5cff5c,ff5cff5c}
JFFS2 notice: (164) check_node_data: wrong data CRC in data node at 0x0006d394: read 0xc96c7e1f, calculated 0xc6974f8f.
JFFS2 notice: (164) check_node_data: wrong data CRC in data node at 0x0006be3c: read 0xfaffca56, calculated 0x4e72e8e5.
JFFS2 notice: (164) jffs2_get_inode_nodes: Node header CRC failed at 0x071460. {ff1c,ff1c,ff1cff1c,ff1cff1c}
JFFS2 notice: (164) read_dnode: node CRC failed on dnode at 0x0709ac: read 0x8db9f359, calculated 0x22676b8
JFFS2 notice: (164) jffs2_get_inode_nodes: Node header CRC failed at 0x06fea4. {ff1c,ff1c,ff1cff1c,ff1cff1c}
JFFS2 notice: (164) jffs2_get_inode_nodes: Node header CRC failed at 0x06f3b4. {1985,e002,0000df5e,a5032844}
JFFS2 notice: (164) read_dnode: node CRC failed on dnode at 0x06e91c: read 0x603ebf95, calculated 0x28f62bdb
JFFS2 notice: (164) check_node_data: wrong data CRC in data node at 0x00071d6c: read 0xe3e40d9c, calculated 0x3b79fefa.
JFFS2 warning: (164) jffs2_do_read_inode_internal: Truncating ino #29 to 23732 bytes failed because it only had 12288 bytes to start with!
JFFS2 notice: (164) check_node_data: wrong data CRC in data node at 0x0007c694: read 0xe9808a11, calculated 0x98c8ae6e.
JFFS2 notice: (164) check_node_data: wrong data CRC in data node at 0x00076ba0: read 0x8207a914, calculated 0xa68949a.
0x090240. {ff5c,ff5c,ff5cff5c,ff5cff5c}
JFFS2 notice: (164) jffs2_get_inode_nodes: Node header CRC failed at 0x08dc84. {ff1c,ff1c,ff1cff1c,ff1cff1c}
Node totlen on flash (0xdf1edf1e) != totlen from node ref (0x000009d8)
JFFS2 notice: (164) jffs2_get_inode_nodes: Node header CRC failed at 0x08d1e8. {1985,e002,ff5cff5c,415e1f8f}
JFFS2 notice: (164) read_dnode: node CRC failed on dnode at 0x08c7b4: read 0x62c24375, calculated 0x4b07ea0
JFFS2 notice: (164) jffs2_get_inode_nodes: Node header CRC failed at 0x08b19c.
/>
重启,则不会有如上CRC错误信息。

问题原因:
我在烧写jffs2 img之前,使用fis init -f 来擦除flash。

fis init -f 命令执行完以后,flash空间就都是0xFF了!即使在mkfs.jffs2的时候使用'-p'参数指定最终输出img的大小,但是超出文件系统的部分也会被填充为0xFF!但这可不是jffs2的格式!
我用fis create分了5M多(0x590000)的分区,但是jffs2fs.img只有不到3M(0x250000),那么
把它烧写到flash以后,分区中除了jffs2 img之外剩余的flash空间(大概2M)全是0xFF,这不是jffs2要求的格式,所以,会发出CRC错误的信息。

假如有一种工具,他可以将flash format为jffs2的格式,那么就不会出现这个问题了。

目前我还没有找到这种工具,但是,可以确信的是:上面的CRC错误是不影响jffs2文件系统的使用的!
The kernel is uClinux-dist.R1.1-RC3.
The Memory chip is an 8MB M25P64 device.
I created the jffs2 image originally using: mkfs.jffs2 -p 0x400000 -e 0x400000 -d jffsdir -o jffs2.img This was done on the target device.
I think i may have found one possible issue looking again at my configuration..
I have the bootloader in the first 1mb, the jffs2 in 1-5 (4 mb) and the kernel is at 5-8 (3 mb). However, on that basis my partition data below is incorrect.
static struct mtd_partition bfin_spi_flash_partitions[] = {
{
.name = "bootloader",
.size = 0x20000,
.offset = 0,
.mask_flags = MTD_CAP_ROM
},{
.name = "file system",
.size = 0x400000,
.offset = 0x100000,
},{
.name = "kernel",
.size = 0x300000,
.offset = 0x400000
}
};
I think Kernel should be offset 0x500000 nor 0x400000, so i will make this change now.
Another question, what does the MTD_CAP_ROM flag do? Does it make it Read only? If so, should I have this flag on the Kernel as well?
yes, MTD_CAP_ROM makes things read-only. that way you can flag the bootloader as read-only and not worry about userspace accidentally erasing/corrupting it.
some people like to update the kernel from userspace rather than the boot loader ... so that should dictate whether you set MTD_CAP_ROM on the kernel partition
This error is thrown only the _first_ _time_ I erase the flash partition and flash the image to the partition. From next time booting (without re-flashing the image) this error is not shown by the Kernel. Each time I relash the partition with the _same_ _JFFS2_ image to the same location in flash the locations shown in CRC error keeps changing.
I tried '-p' option in the mkfs.jffs2 utility this error is not coming.
-p, --pad[=SIZE] Pad output to SIZE bytes with 0xFF. If SIZE is not specified, the output is padded to the end of
the final erase block
Could anyone let me know why its giving the earler CRC error.。

相关文档
最新文档