[U-Boot] fw_printenv can't read the uboot enviroment from NAND

Mike Frysinger vapier at gentoo.org
Wed Apr 4 19:15:15 CEST 2012


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.
-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/20120404/515532d4/attachment.pgp>


More information about the U-Boot mailing list