AnsweredAssumed Answered

IMX27 Spansion S29WS256P NOR JFFS2 problem

Question asked by John Mackenzie on Jul 4, 2013
Latest reply on Nov 11, 2014 by John Mackenzie

Hi,

 

I suspect this is a Linux issue but maybe someone will be able to help - we have been attempting to get this to work for quite some time now.

 

We have a board using an IMX27 and Spansion NOR flash S29WS256P connected using WEIM.

 

The flash has been proven to work using /dev/mtdblockX with random data.

 

The problem occurs when writing a large file to a jffs2 partition, then re-mounting the partition, the file becomes corrupted: or lost sometimes:

 

flash_erase /dev/mtd4 0 0

mount -t jffs2 mtd4 /mnt/flash/

dd if=/dev/urandom of=/tmp/test.bin bs=1M count=2

2+0 records in

2+0 records out

cp /tmp/test.bin /mnt/flash/

md5sum /tmp/test.bin

0421170b11c920a5c898fab5bca2f981  /tmp/test.bin

md5sum /mnt/flash/test.bin

0421170b11c920a5c898fab5bca2f981  /mnt/flash/test.bin

umount /mnt/flash/

mount -t jffs2 mtd4 /mnt/flash/

md5sum /mnt/flash/test.bin

ba42d6eba9481c386876027514275a7c  /mnt/flash/test.bin <== corrupt

 

Kernel messages during the remount are:

 

[ 1862.430000] Empty flash at 0x0009106c ends at 0x00094140

[ 1862.440000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00094140: 0x586d instead

[ 1862.450000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00094144: 0x0086 instead

[ 1862.460000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00094148: 0x0066 instead

[ 1862.470000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0009414c: 0x81a4 instead

[ 1862.480000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00094154: 0x2000 instead

[ 1862.490000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00094158: 0xa9fd instead

[ 1862.490000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x0009415c: 0xa9fd instead

[ 1862.500000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00094160: 0xa9fd instead

[ 1862.510000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00094164: 0x1000 instead

[ 1862.520000] jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x00094168: 0x1000 instead

[ 1862.530000] Further such events for this erase block will not be printed

[ 1862.540000] Empty flash at 0x00094e80 ends at 0x00094ec0

[ 1862.550000] Empty flash at 0x0009517c ends at 0x00095180

 

 

We are using linux-2.6.38.7. JFFS2 write buffering and summary support are both disabled.

 

Compiling the kernel with MTD/JFFS2 debug we have confirmed the correct CFI information is being obtained from the flash device.

 

Many thanks in advance,

 

John Mackenzie

 

 

 

 

Outcomes