[U-Boot] error executing fw_printenv

twebb taliaferro62 at gmail.com
Fri Dec 11 18:29:28 CET 2009


I've cross-compiled and am running fw_printenv on an ARM system using
linux-2.6.28.  The u-boot environment is kept in SPI-based NOR flash.
The configuration within fw_env.h is...

//#define CONFIG_FILE     "/etc/fw_env.config"
//#define HAVE_REDUND /* For systems with 2 env sectors */
#define DEVICE1_NAME      "/dev/mtd7"
#define DEVICE1_OFFSET    0x00080000
#define ENV1_SIZE         0x00020000
#define DEVICE1_ESIZE     0x00010000
#define DEVICE1_ENVSECTORS     0        /* should be ignored for NOR */

I get the following error when executing fw_printenv...

Read error on /dev/mtd7: Success

Adding some debug, I've determined that the error results from the
read of mtd7 returning 0 bytes read.

*** mtdinfo.type = NOR
*** Read 0 bytes, readlen = 131072, seek = 524288
Read error on /dev/mtd7: Success

However, using the command...

dd if=/dev/mtd7 of=/tmp/dummy bs=512 count=1 skip=1024

dummy contains the u-boot environment area as I would expect.  Any
ideas why the read is returning 0?

Thanks,
twebb


More information about the U-Boot mailing list