Skip to contentSkip to conversation

NAND and JFFS2 newbie question

DISCUSSION Will Wagner 2 participants 3 messages Jan 27, 2009 – Jan 28, 2009 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi All,

I have an arm iMx31 board with 128M of NAND flash. It all appears to be working however I get a lot of error/warning messages and I'd just like to check I am doing things right.

The NAND chip is a ST NAND01G-B2B used in 8-bit mode which has 2048+64 byte pages and 128k block size. Linux is 2.6.24.7 with Freescale patches for MTD support on the iMx31 chip.

I am wanting to create a JFFS2 partition on the device. The partition is created using:

mkfs.jffs2 -s 2 -e 128 -c 12 -o fs.jffs2 -r jffs2_fs

Are these the correct arguments for the flash device I am using?

On the target I then do:

Quoted 1 line

flash_eraseall /dev/mtd4

Erasing 128 Kibyte @ 5f60000 -- 99 % complete.
Skipping bad block at 0x05f80000

Skipping bad block at 0x05fa0000

Skipping bad block at 0x05fc0000

Skipping bad block at 0x05fe0000

Quoted 1 line

nandwrite -p /dev/mtdblock4 fs.jffs2

Writing data to block 0

Quoted 1 line

mount -t jffs2 /dev/mtdblock4 /flashfs

JFFS2 doesn't use OOB.
CLEANMARKER node found at 0x00000000 has totlen 0xc != normal 0x0 jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x05fc0010: 0xffff instead jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x05fe0010: 0xffff instead # nand_erase: attempt to erase a bad block at page 0x0000ff80
Erase at 0x05fc0000 failed immediately: errno -5
nand_erase: attempt to erase a bad block at page 0x0000ffc0
Erase at 0x05fe0000 failed immediately: errno -5

Does this seem right? Why doesn't it use OOB and why is the cleanmarker wrong?

It all seems to be working but any advice on whether I am doing things write and if the output is all acceptable warnings would be much appreciated.

Thanks,

Will

Signature · 5 lines
------------------------------------------------------------------------
Will Wagner                                     [email protected]
Development Manager                      Office Tel: +44 (0)20 7371 2032
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------
#1 lore raw
Quoted 11 lines · Will Wagner

Hi All,

I have an arm iMx31 board with 128M of NAND flash. It all appears to be working however I get a lot of error/warning messages and I'd just like to check I am doing things right.

The NAND chip is a ST NAND01G-B2B used in 8-bit mode which has 2048+64 byte pages and 128k block size. Linux is 2.6.24.7 with Freescale patches for MTD support on the iMx31 chip.

I am wanting to create a JFFS2 partition on the device. The partition is created using:

mkfs.jffs2 -s 2 -e 128 -c 12 -o fs.jffs2 -r jffs2_fs

I guess one of the problems will be that the sizes you specified are way too small. Fomr the man-page of mkfs.jffs2:
"Options that take SIZE arguments can be specified as either decimal (e.g., 65536), octal (0200000), or hexidecimal (0x1000)"

So for an eraseblocksize of 128kbytes you would specify "-e 131072".

Wrong settings can confuse jffs2 pretty easily.

Quoted 2 lines

Thanks,
Will

Cheers
nils faerber

Signature · 4 lines
kernel concepts GbR        Tel: +49-271-771091-12
Sieghuetter Hauptweg 48    Fax: +49-271-771091-19
D-57072 Siegen             Mob: +49-176-21024535
http://www.kernelconcepts.de
#2 lore raw
Quoted 9 lines · Nils Faerber
Quoted 3 lines

I am wanting to create a JFFS2 partition on the device. The partition is created using:

mkfs.jffs2 -s 2 -e 128 -c 12 -o fs.jffs2 -r jffs2_fs

I guess one of the problems will be that the sizes you specified are way too small. Fomr the man-page of mkfs.jffs2:
"Options that take SIZE arguments can be specified as either decimal (e.g., 65536), octal (0200000), or hexidecimal (0x1000)"

The man page seemed to imply that values under 4096 would be treated as KiB so -e 128 should be correct. However the page size looks like it doesn't do that and so it should be set to 2048.

As an aside do I need to specify the -c option or is it not needed? If it is needed is 12 the correct size for the clean marker?

Thanks,

Will

Signature · 5 lines
------------------------------------------------------------------------
Will Wagner                                     [email protected]
Development Manager                      Office Tel: +44 (0)20 7371 2032
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------