Hi,
I'm encountering some problems when flashing a jffs2 filesystem image file to my DM365 EVM. It seems that the flashed image is correct, but any change to the file system then cause ECC errors. I'm using mtd-utils included with PSP 2.10.00.14 (mtd-utils-v1.1-lsp200). Please try this:
On the host system, create a new test directory and a test file on it. Then create a jffs2 file system image using the "mkfs.jffs2" program:
host: mkdir test
host: echo testcontent > test/testfile
host: mkfs.jffs2 -e 0x20000 -p -l -s 0x800 -n -d ./test -o testfs.jffs2
Then on the EVM board I mount an nfs partition containing the image file (i'll skip this part of the commands), then write the image to flash. If I mount the mtd partition, there are no errors. When I modify the file system (adding a new file), then ECC errors are shown when remounting it.
The following commands will write the image file to mtd6, please choose an mtd device suitable for your board:
EVM: flash_eraseall -j /dev/mtd6
EVM: nandwrite -p /dev/mtd6 /mnt/nfs/testfs.jffs2
Now I'll mount the new file system and check the content of the file added in the first step. No errors will be issued:
EVM: mount -t jffs2 /dev/mtdblock6 /mnt/point
EVM: cat /mnt/point/testfile
Then I add a new file, still no errors:
EVM: echo newtestcontent > /mnt/point/newtestfile
EVM: cat /mnt/point/newtestfile
EVM: umount /mnt/point
Now if I remount the file system, ECC errors are issued:
EVM: mount -t jffs2 /dev/mtdblock6 /mnt/point
nand_davinci_4bit_compare_ecc Too many errors to be corrected!
mtd->read(0x1fc00 bytes from 0x400) returned ECC error
Empty flash at 0x00000080 ends at 0x00000800
nand_davinci_4bit_compare_ecc Too many errors to be corrected!
mtd->read(0x7bc bytes from 0x844) returned ECC error
nand_davinci_4bit_compare_ecc Too many errors to be corrected!
mtd->read(0x788 bytes from 0x878) returned ECC error
Can you please check if this happens on your board too? Is this a bug in the supplied mtd utils or the kernel mtd driver?