Programming ubinized images

Ricard Wanderlof ricard.wanderlof at axis.com
Tue Apr 26 03:37:44 EDT 2011


On Mon, 25 Apr 2011, Matthew L. Creech wrote:

> Hi,
>
> I'm curious about the implications of these notes in the UBI documentation:
>
> http://www.linux-mtd.infradead.org/faq/ubi.html#L_ecc_error
> http://www.linux-mtd.infradead.org/faq/ubifs.html#L_why_ubiformat
> http://www.linux-mtd.infradead.org/faq/ubifs.html#L_mkfubifs
> http://www.linux-mtd.infradead.org/doc/ubi.html#L_flasher_algo
>
> which seem to be saying that:
>
> 1. A ubinized image can contain empty (all-0xff) pages at the end
> 2. At run-time, it will assume that these pages are completely erased
> (including corresponding OOB areas)
> 3. Standard NAND flashing utilities will view the 0xff pages as normal
> data and program their OOB areas

Yes,

> 4. This will cause errors when UBIFS tries to use these areas, because
> it double-programs OOB/ECC (presumably resulting in some sort of
> ANDing of bits)

Not quite, the problem is that NAND flash doesn't allow programming the 
same area more than a couple of times (before it is erased again), even if 
it was 'programmed' to all-ones the first time. It's not that the bits get 
ANDed, it's that the bit cells aren't designed to be programmed more than 
two or three times, and mtd/UBI uses all those times for its own use. So 
you end up operating the device out of spec, which turns out to fail for 
certain devices.

> Does this mean that an off-the-shelf NAND programmer can't be used to
> program UBIFS images onto a flash device?

That is my understanding, allthough 'off-the-shelf' is a pretty wide 
generalization, it would be conceivable that some programmers can handle 
this, although I have no idea if this in fact is the case.

> Or perhaps that I need to be post-processing the ubinized images to 
> strip out empty pages from the end of the image before giving it to the 
> production line?

That should work too.

/Ricard
-- 
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30



More information about the linux-mtd mailing list