[U-Boot] dfu: dfu and UBI Volumes

Wolfgang Denk wd at denx.de
Fri May 24 20:41:28 CEST 2013


Dear Pantelis Antoniou,

In message <6AD958CB-3CFC-4362-B72D-511147D041AC at antoniou-consulting.com> you wrote:
> 
> > How To do this? Current state on this board is to erase the rootfs
> > mtd partition with a nand erase and write the new image using
> > dfu_nand.c ... which calls in the end nand_write ... which is ...
> > lets say ... not the prefered way on an UBI volume ...
> > 
> > How to solve this? Any ideas?
> 
> Well, what would you like ideally to do? Why is nand_write not ideal for
> a UBI volume.

The key problem is that nand_erase will destroy all UBI wear levelling
and erase counters.  When working with UBI, you NEVER want to do this.

See for example [1] for reference.

> Note that dfu will skip over the bad blocks... 

Which is even worse here.

DFU should be able to deal with UBI volumes, and using proper access
routines (ubi write) to write the new volume(s).  But never ever
should any low level erase of the underlying flash device be needed
nor used.

[1] http://www.linux-mtd.infradead.org/doc/ubi.html#L_format

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
What's the sound a name makes when it's dropped?


More information about the U-Boot mailing list