[U-Boot] fw_setenv broken?

Steve Sakoman steve at sakoman.com
Wed Nov 17 17:30:24 CET 2010


I'm seeing some strange behavior with the fw_setenv tools on OMAP.

Here's what I see when using the tools on OMAP (overo in this case):

1. fw_printenv prints the environment with no issues [1]
2. fw_setenv allows me to change a variable with no reported errors [2]
3. fw_printenv will print the changed environment, however the variables
are not sorted [3]
4. Since all seems well at this point, I reboot.  There is an error
reading the new environment [4]

I added debug printf's to readenv() in env_nand.c and the root cause is
an error return from ret=nand_read(&nand_info[0], offset, &len,
char_ptr)).  I get an error code of -74

Before I spend too much time on this I wanted to check to see if others
are seeing this issue, or whether it might be OMAP specific.

Regards,

Steve


[1] 

root at omap3-multi:~# fw_printenv 
baudrate=115200
bootcmd=if mmc rescan ${mmcdev}; then if run loadbootscript; then run
bootscript; else if run loaduimage; then run mmcboot; else run nandboot;
fi; fi; else run nandboot; fi
bootdelay=5
bootscript=echo Running bootscript from mmc ...; source ${loadaddr}
console=ttyS2,115200n8
defaultdisplay=dvi
dieid#=1e1e00040000000004032d460d01900b
dvimode=1024x768MR-16 at 60
ethact=smc911x-0
loadaddr=0x82000000
loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr
loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage
mmcargs=setenv bootargs console=${console} mpurate=${mpurate} vram=
${vram} omapfb.mode=dvi:${dvimode} omapfb.debug=y omapdss.def_disp=
${defaultdisplay} root=${mmcroot} rootfstype=${mmcrootfstype}
mmcboot=echo Booting from mmc ...; run mmcargs; bootm ${loadaddr}
mmcdev=0
mmcroot=/dev/mmcblk0p2 rw
mmcrootfstype=ext3 rootwait
mpurate=500
nandargs=setenv bootargs console=${console} mpurate=${mpurate} vram=
${vram} omapfb.mode=dvi:${dvimode} omapfb.debug=y omapdss.def_disp=
${defaultdisplay} root=${nandroot} rootfstype=${nandrootfstype}
nandboot=echo Booting from nand ...; run nandargs; nand read ${loadaddr}
280000 400000; bootm ${loadaddr}
nandroot=/dev/mtdblock4 rw
nandrootfstype=jffs2
stderr=serial
stdin=serial
stdout=serial
vram=12M

[2]

root at omap3-multi:~# fw_setenv mpurate 720

[3]

root at omap3-multi:~# fw_printenv 
baudrate=115200
bootcmd=if mmc rescan ${mmcdev}; then if run loadbootscript; then run
bootscript; else if run loaduimage; then run mmcboot; else run nandboot;
fi; fi; else run nandboot; fi
bootdelay=5
bootscript=echo Running bootscript from mmc ...; source ${loadaddr}
console=ttyS2,115200n8
defaultdisplay=dvi
dieid#=1e1e00040000000004032d460d01900b
dvimode=1024x768MR-16 at 60
ethact=smc911x-0
loadaddr=0x82000000
loadbootscript=fatload mmc ${mmcdev} ${loadaddr} boot.scr
loaduimage=fatload mmc ${mmcdev} ${loadaddr} uImage
mmcargs=setenv bootargs console=${console} mpurate=${mpurate} vram=
${vram} omapfb.mode=dvi:${dvimode} omapfb.debug=y omapdss.def_disp=
${defaultdisplay} root=${mmcroot} rootfstype=${mmcrootfstype}
mmcboot=echo Booting from mmc ...; run mmcargs; bootm ${loadaddr}
mmcdev=0
mmcroot=/dev/mmcblk0p2 rw
mmcrootfstype=ext3 rootwait
nandargs=setenv bootargs console=${console} mpurate=${mpurate} vram=
${vram} omapfb.mode=dvi:${dvimode} omapfb.debug=y omapdss.def_disp=
${defaultdisplay} root=${nandroot} rootfstype=${nandrootfstype}
nandboot=echo Booting from nand ...; run nandargs; nand read ${loadaddr}
280000 400000; bootm ${loadaddr}
nandroot=/dev/mtdblock4 rw
nandrootfstype=jffs2
stderr=serial
stdin=serial
stdout=serial
vram=12M
mpurate=720

[4]

U-Boot 2010.12-rc1 (Nov 17 2010 - 08:04:09)

OMAP3530-GP ES3.1, CPU-OPP2, L3-165MHz, Max CPU Clock 600 mHz
Gumstix Overo board + LPDDR/NAND
I2C:   ready
DRAM:  256 MiB
NAND:  256 MiB
MMC:   OMAP SD/MMC: 0
*** Warning - readenv() failed, using default environment





More information about the U-Boot mailing list