Skip to contentSkip to conversation

setting PAD parameter with JFFS2 and NAND -- what is correct thing to do ?

DISCUSSION Philip Rakity 2 participants 2 messages Dec 2, 2008 – Dec 3, 2008 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

I am trying to understand what value to set the pad parameter to when making a JFFS2 image (including using sumtool) for NAND flash.

The NAND flash has 2KiB sectors, 256KiB erase size, and is 2GB.

I use flase_eraseall -j when erasing the flash and the flash HAS bad blocks.

The image size is less than the 2GB size of the flash.

I have tried both specifying pad (rounded up) to the erase block size and omitting pad. When I write to the NAND there are recovered CRC errors from time to time as well as the other "errors" indicated in the FAQ.

If could set pad to the SIZE of the NAND flash, but because of bad blocks I am not sure this is correct...

Guidance Please.

Philip

#1 lore raw
Quoted 13 lines · Philip Rakity

I am trying to understand what value to set the pad parameter to when making a JFFS2 image (including using sumtool) for NAND flash.

The NAND flash has 2KiB sectors, 256KiB erase size, and is 2GB.

I use flase_eraseall -j when erasing the flash and the flash HAS bad blocks.

The image size is less than the 2GB size of the flash.

I have tried both specifying pad (rounded up) to the erase block size and omitting pad. When I write to the NAND there are recovered CRC errors from time to time as well as the other "errors" indicated in the FAQ.

Quoted 6 lines

If could set pad to the SIZE of the NAND flash, but because of bad blocks I am not sure this is correct...

Guidance Please.

Philip

Philip:

You should set the padding to the page size. For the two systems I have, the mkfs.jffs2 commands used to build the root file systems are as follows:

    mkfs.jffs2 --big-endian \
    --no-cleanmarkers \
    --pad 512 \
    --pagesize 512 \
    --eraseblock 16384 \
    -d /tmp/fs/stripped/root \
    -D root.devtable \
    -o root.jffs2

and:

    mkfs.jffs2 --big-endian \
    --no-cleanmarkers \
    --pad 2048 \
    --pagesize 2048 \
    --eraseblock 131072 \
    -d /tmp/fs/stripped/root \
    -D root.devtable \
    -o root.jffs2

Regards,

Grant