[U-Boot] dfu, nand: writing on not empty nand partition

Heiko Schocher hs at denx.de
Thu Jun 13 14:52:14 CEST 2013


Hello Tom,

Am 13.06.2013 14:33, schrieb Tom Rini:
> On 06/13/2013 08:15 AM, Heiko Schocher wrote:
>> Hello,
> 
>> I just tried to write with "dfu" and dfu-util on the host to a not
>> empty partiton on a nand flash. After the dfu returned without
>> error, I wanted to read the nand partiton with "nand read" and I
>> get ECC errors. This is on an am335x based board (mainline patches
>> coming soon) with ECC BCH8 enabled...
> [snip]
>> Is this a bug or a feature?
> 
>> If it is a bug, I fixed it as I added in my tree in
>> drivers/mtd/nand/nand_util.c a nand_erase_write_skip_bad()
>> function, which erases before writes to "off, length" ... and call
>> this function in drivers/dfu/dfu_nand.c nand_block_op() instead
>> nand_write_skip_bad() ... Is this a possible solution?
> 
> So yes, if you don't erase first, just like doing a nand write from
> the command line, it will fail.  This is arguably a bug.  But, I would
> go for making dfu_nand spell out a call to an existing erase function
> since we know the size of the alt setting to be written to.

Ok, can do it this way also ...

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


More information about the U-Boot mailing list