[Openpxa-users] PXA310: double bit errors on NAND
Bjørn Forsman
bjorn.forsman at gmail.com
Sat Jan 15 12:01:25 EST 2011
Hi,
Seems I forgot to send this mail. Better late than never?
2010/11/9 pieterg <pieterg at gmx.com>:
> On Tuesday, November 09, 2010 10:15:40 Bjørn Forsman wrote:
>> I've tried nandwrite with or without the --pad option. Is that the
>> padding you are referring to? Or is it the --blockalign option? How
>> exactly did you flash your rootfs?
>
> nandwrite -p pads to pagesize, which is ok.
> But I was using a --pad=0x800 (=pagesize) option for mkfs.jffs2 instead,
> which somehow resulted in eraseblock padding.
>
>> Thanks for the info. Note that I've had *zero* trouble with ubifs when
>> it's flashed with ubiformat and ubiupdatevol. I did some more googling
>> and found some other threads about the "ubiformat + ubiupdatevol works
>> but not direct UBI image flashing" issue. I'll take a closer look.
>
> Interesting. In that case I might give that a try as well, as jffs2 is still
> far from perfect, even with correct pagesize padding.
>
> I've added a single bit debug message in the nand driver by the way,
> which shows a lot of lucky escapes, before the first double bit error
> eventually occurs. Which seems inevitable, as the driver takes
> no action (such as refreshing a page) when single bit errors occur.
Turns out that the errors I got when using jffs2 was because
of a bug in mkfs.jffs2. I was testing jffs2 with an image generated
by Buildroot, and Buildroot was using a mkfs.jffs2 affected by this bug
until mid october (I hadn't updated my tree in
a while). mkfs.jffs2 on my build host (Ubuntu 10.04) is not affected.
So now jffs2 is working great:
flash_eraseall /dev/mtd7
nandwrite -p /dev/mtd7 /rootfs.jffs2
mount -t jffs2 /dev/mtdblock7 /mnt
UBIFS with ubiupdatevol is working great:
ubiformat /dev/mtd8
ubiattach -m 8
ubimkvol /dev/ubi0 -N rootfs -m
ubiupdatevol /dev/ubi0_0 /rootfs.ubifs
However, UBI images are broken after mounting them once in
read-write mode if they were flashed with either 'nandwrite' or
U-Boot 'nand write'. Mounting read-only always works.
I'd like to know how UBI images is supposed to be flashed.
By searching the internet I've seen people saying that it is
impossible to write UBI images with nandwrite and others say
it *is* possible. By looking at
http://www.linux-mtd.infradead.org/doc/ubi.html#L_flasher_algo
it may appear that flashing UBI images requires an UBI aware flasher?
But isn't the whole point of having ubinize so that you can take UBIFS
images and wrap them into something that non UBIFS aware flashers can handle?
What am I missing?
Best regards,
Bjørn Forsman
More information about the linux-mtd
mailing list