Nand flash and jffs2 image problem

Michel LECONTE michel.leconte at sacet.com
Thu Mar 8 04:40:28 EST 2007


Hi everybody,

I'm using a compulab cm-x255 card with the 2.6.18-rc2 kernel.
I have some problems with the NAND flash (512MB) and jffs2 image.
Here is what I have done :

First I verify the mtd devices:
# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00400000 00010000 "physmap-flash.0"
mtd1: 20000000 00020000 "rootfs"

Then I erased flash with :
# ./flash_eraseall -j /dev/mtd1
Erasing 128 Kibyte @ 360000 --  0 % complete. Cleanmarker written at 360000.
Skipping bad block at 0x00380000
Erasing 128 Kibyte @ 4ec0000 -- 15 % complete. Cleanmarker written at
4ec0000.
Skipping bad block at 0x04ee0000
Erasing 128 Kibyte @ e360000 -- 44 % complete. Cleanmarker written at
e360000.
Skipping bad block at 0x0e380000
Erasing 128 Kibyte @ 12a60000 -- 58 % complete. Cleanmarker written at
12a60000.
Skipping bad block at 0x12a80000
Erasing 128 Kibyte @ 12cc0000 -- 58 % complete. Cleanmarker written at
12cc0000.
Skipping bad block at 0x12ce0000
Erasing 128 Kibyte @ 17de0000 -- 74 % complete. Cleanmarker written at
17de0000.
Skipping bad block at 0x17e00000
Erasing 128 Kibyte @ 181a0000 -- 75 % complete. Cleanmarker written at
181a0000.
Skipping bad block at 0x181c0000
Erasing 128 Kibyte @ 18860000 -- 76 % complete. Cleanmarker written at
18860000.
Skipping bad block at 0x18880000
Erasing 128 Kibyte @ 1ffe0000 -- 99 % complete. Cleanmarker written at
1ffe0000.

I make an jffs2 image with :
# mkfs.jffs2 -l --pad=0x20000000 --eraseblock=0x20000 -d /opt/Debian_Ref
-o jffs2.img

I copy the image on flash :
# dd if=/opt/jffs2.img of=/dev/mtdblock1

dd: writing to `/dev/mtdblock1': Input/output error

7169+0 records in
7168+0 records out
3670016 bytes (3.7 MB) copied, 9.50543 seconds, 386 kB/s

I tried also :
# mkfs.jffs2 -d /opt/Debian_Ref -o jffs2.img
# mkfs.jffs2 -l --eraseblock=0x20000 -d /opt/Debian_Ref -o jffs2.img
and
# sdd instead of dd
but all without result.

I would like to know what I'm missing ?
Is it the good method ?
Can I just copy files with "cp" from an ext2 disk to the jffs2 flash or
I have to create an jffs2 image like what I have done ?

Thanks for your help.


Michel.




More information about the linux-mtd mailing list