Flashfilesystem JFFS2

From InCircuit
Jump to: navigation, search

On NOR-Flash, JFFS2 is the most common and suitable filesystem to use. It can be used on NAND-Flash, too but have some disadvantages. Here it is possible, that messages like

 jffs2_scan_inode_node(): CRC failed on node at 0x005e6fd8: Read 0xffffffff, calculated 0x893fb541

appear. As those are harmless themselves, they might become annoying. To circumvent these, it is possible to use an UBIFS Image instead. The messages appear, as on NAND-Flash a read-operation can result in altering the flashs content. this can be detected using checksums and the filesystem will copy the (corrected) data up on such a failure, but the message appears until the corresponding block in flash gets overwritten the next time.

Creating JFFS2-filesystem

The buildroot will create a JFFS2 Image corresponding to the selected board automatically. This can be found in the directory 'binaries' within buildroot. The simplest way to update such an filesystem us to boot via NFS and simply replace the image. The exact partition may differ, but in the following example the contents of the MTD-Partition 1 will be replaced, as it is valid on most ICnova SAM9G45 and ICnova OEMplus based boards.

First any old contents should be wiped

 flash_eraseall /dev/mtd1

Now the new contents can be written. The corresponding Image has to be copied into the NFS-Export in advance

 dd if=/rootfs.arm.jffs2 of=/dev/mtdblock1 bs=131072
Personal tools