[U-Boot] fw_printenv can't read the uboot enviroment from NAND
Mike Frysinger
vapier at gentoo.org
Thu Apr 5 07:23:21 CEST 2012
On Wednesday 04 April 2012 13:15:15 Mike Frysinger wrote:
> On Wednesday 04 April 2012 12:00:42 Bishop, Mark wrote:
> > root:/> cat /etc/fw_env.config
> > /dev/mtd0 0x60000 0x20000 0x20000 1
> >
> > ioctl(3, MEMGETINFO, {type=MTD_NANDFLASH,
> > flags=MTD_WRITEABLE, size=0x80000, erasesize=0x20000, writesize=0x800,
> > oobsize=0x40, padding=0xffffffff}) = 0
> > ioctl(3, MEMGETBADBLOCK, [0x60000]) = 1
> > ioctl(3, MEMGETBADBLOCK, [0x80000]) = -1 EINVAL (Invalid argument)
>
> to summarize further: the flash is 0x80000 bytes long, and he's using the
> last sector in flash to hold his env, and fw_printenv seems to have an
> off-by-one in the badblock check. there's no reason it should be checking
> 0x80000.
actually, reading it a bit more, it seems your NAND has that last block marked
as bad. so the fw_printenv code is working correctly. it moved on to the
next one.
it should have printed out:
Too few good blocks within range
but since it walked past the end of the flash, you got:
Cannot read bad block mark: Invalid argument
so the tool should be updated slightly
might want to figure out why that block is bad in your NAND.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120405/a7cf03c1/attachment.pgp>
More information about the U-Boot
mailing list