[U-Boot-Users] problem with saveenv command if CFG_ENV_IS_IN_EEPROM...

sean chang schang at usc.edu
Sat Jun 12 01:06:55 CEST 2004


Hi all,

A quick question.

If I have my environment variables stored in eeprom (i.e. define CFG_ENV_IS_IN_EEPROM), I should be able to use the saveenv command to save any user modified env values back to eeprom right?

But U_BOOT_CMD saveenv does not get compiled unless I have defined both CFG_CMD_ENV and CFG_CMD_FLASH.  Also, if you look at the function do_saveenv, which is called when user uses the saveenv command, it does get compiled if I only define CFG_ENV_IS_IN_EEPROM alone.

Am I missing something or is there a problem?  Any help is greatly appreciated.

Thanks,
Sean


copied from common/cmd_nvedit.c
================================================================================
#if ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == 
(CFG_CMD_ENV|CFG_CMD_FLASH))

U_BOOT_CMD(
 saveenv, 1, 0, do_saveenv,
 "saveenv - save environment variables to persistent storage\n",
 NULL
);

#endif /* CFG_CMD_ENV */

#if (CONFIG_COMMANDS & CFG_CMD_ASKENV)

===================================================================
#if defined(CFG_ENV_IS_IN_NVRAM) || defined(CFG_ENV_IS_IN_EEPROM) || \
    ((CONFIG_COMMANDS & (CFG_CMD_ENV|CFG_CMD_FLASH)) == \
      (CFG_CMD_ENV|CFG_CMD_FLASH))
int do_saveenv (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
 extern char * env_name_spec;

 printf ("Saving Environment to %s...\n", env_name_spec);

 return (saveenv() ? 1 : 0);
}








More information about the U-Boot mailing list