[U-Boot] fw_printenv help needed

Glen VanMilligan glenvm at gmail.com
Tue Jul 26 18:05:50 CEST 2011


I have an application that needs to access the environment setting of
uboot.  I see that fw_printenv is available to do the job.  The problem for
me is how do I set uboot and mtd for using this device?

When I run the fw_printenv, I get the message "Can't open /dev/mtd0: No such
device or address"

This implies that an MTD device is setup.  I have the MTD turned on in the
kernel, because in /dev I see four mtd0-mtd3 devices, four
mtdblock0-mtdblock3 devices.  However, if I cat the /proc/mtd file, I get a
blank listing.
 # cat /proc/mtd
dev:    size   erasesize  name
#
I do have a fw_env.config file in the /etc directory that looks like this:

# Configuration file for fw_(printenv/saveenv) utility.
# Up to two entries are valid, ic this case the redundant
#   environment sector is assumed present.

#MTD Device name, Device offset, Env. size, Flash sector size
/dev/mtd0         0x60000        0x40000    0x20000

So the question is, how do I mount and use this to make this device
available?

--Glen


More information about the U-Boot mailing list