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

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); }

Dear Sean,
in message 6cf7690b67f9.40c9d89f@usc.edu you wrote:
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?
Sure. That's how it works on quite a lot of boards.
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.
Will you please restrict your line legth to some 70 characters or so? thanks.
Yes, the "saveenv" command entry only gets compiled when the CFG_CMD_ENV or CFG_CMD_FLASH options are enabled in your CONFIG_COMMANDS settings.
And the do_saveenv() code only gets compiled when the CFG_CMD_ENV or CFG_CMD_FLASH options are enabled in your CONFIG_COMMANDS settings, or when your environment is in EEPROM or in NVRAM.
Am I missing something or is there a problem? Any help is greatly appreciated.
There is no problem.
Why are you asking?
Best regards,
Wolfgang Denk
participants (2)
-
sean chang
-
Wolfgang Denk