[U-Boot] fw_printenv help needed

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

I spent all day, but I think the answer to my question is that the kernel needs to be constructed with the CONFIG_MTD_CMDLINE_PARTS set to '"Y". Now I can see two MTD partition in the /proc/mtd file.
I'm still having a problem with fw_printenv. My output is: # fw_printenv MTD_open MTD_ioctl MTD_ioctl CannoMTD_close t read bad block mark: Invalid argument # Comments? --Glen
On Tue, Jul 26, 2011 at 11:05 AM, Glen VanMilligan glenvm@gmail.com wrote:
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
participants (1)
-
Glen VanMilligan