From: borasah@gmail.com
To: linux-mtd@lists.infradead.org
Cc: Ricard Wanderlof <ricard.wanderlof@axis.com>
Subject: Re: NAND flash write goes wrong
Date: Fri, 11 May 2007 16:56:23 +0300 [thread overview]
Message-ID: <200705111656.24216.borasah@gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0705110825530.3951@lnxricardw.se.axis.com>
> > compiled them for both the host and the target. I am using "mkfs.jffs2
> > command on the host" to generate a jffs2 image.
> > ./mkfs.jffs2 -p 0x3800000 -s 0x200 -e 0x4000 -r rootfs -o img -l
>
> I don't know if this is it but
>
> - I wouldn't pad the output image using -p <padsize>. Since there may be
> bad blocks in the flash, the image might not fit if padded to the
> whole partition size. Just skip the -p and its argument. As long as
> the whole partition into which the image is written has been erased
> beforehand, jffs2 will be able to make use of the unused space.
>
> - The -s <pagesize> argument doesn't specify the page size of the
> flash chip, rather it should be the same as the 'page size' in the
> Linux system, normally 4096 for most architectures.
>
> - In nand flash, the cleanmarkers are normally not part of the image
> as they reside in the 'spare area' in the flash. The JFFS2 driver will
> automatically create cleanmarkers when it scans the chip at first boot,
> and having them in the image will confuse the issue, even if it normally
> works anway (but with lots of warnings at boot time).
> So, add -n to the list of arguments to inhibit cleanmarker
> generation by mkfs.jffs2.
Thanks for the infos. OK, this means
./mkfs.jffs2 -e 0x4000 -r rootfs -o img -l -n
or
./mkfs.jffs2 -s 0x1000 -e 0x4000 -r rootfs -o img -l -n
right? I checked the target .config, it uses 4K as page size. But I gave
Input file is not page aligned
Data did not fit into device, due to bad blocks
: Success
In fact, I tried without -p and with -n before. Without -p nandwrite gives the
above message. Then I put -p and nandwrite started to write...
> > Erasing 16 Kibyte @ 24000 -- 0 % complete. Cleanmarker written at
> > 24000. Skipping bad block at 0x00028000
> > ...
> > Is this normal? Then I do
> > ./nandwrite /dev/mtd2 img
> > It writes by skipping bad blocks.
> > ...
> > Writing data to block 189c000
> > Bad block at 189c000, 1 block(s) from 189c000 will be skipped
> > Writing data to block 18a0000
> > ...
>
> If there indeed are bad blocks it is correct to skip them both when
> erasing and writing.
OK. What I wanted to learn was different. In the begining there was no bad
sector but by the passage of time, when I tried different combinations, bad
sector numbers started to increase. Is this normal? Or are there some
fundamentally different things between kernel version and mtd-utils so these
marks them as bad?
Thanks...
--
Bora SAHIN
next prev parent reply other threads:[~2007-05-11 13:49 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-10 18:50 NAND flash write goes wrong borasah
2007-05-10 19:16 ` Josh Boyer
2007-05-10 21:37 ` borasah
2007-05-10 22:15 ` Thomas Gleixner
2007-05-10 22:42 ` borasah
2007-05-11 6:36 ` Ricard Wanderlof
2007-05-11 6:57 ` Artem Bityutskiy
2007-05-11 7:16 ` Matthieu CASTET
2007-05-11 7:42 ` Artem Bityutskiy
2007-05-11 7:49 ` Artem Bityutskiy
2007-05-11 13:56 ` borasah [this message]
2007-05-11 14:31 ` Ricard Wanderlof
2007-05-11 17:58 ` borasah
2007-05-14 6:56 ` Ricard Wanderlof
2007-05-21 9:30 ` borasah
[not found] <42E999AD7A0E4647BF159F467EE4FBCB017B5155@BLR-SGM-MSG01.wipro.com>
2007-05-14 7:39 ` Ricard Wanderlof
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200705111656.24216.borasah@gmail.com \
--to=borasah@gmail.com \
--cc=linux-mtd@lists.infradead.org \
--cc=ricard.wanderlof@axis.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.