2011-01-13 11:01:34     Environment in NAND, default_environment, and nandboot field

Document created by Aaronwu Employee on Sep 25, 2013
Version 1Show Document
  • View in full screen mode

2011-01-13 11:01:34     Environment in NAND, default_environment, and nandboot field

Reggy Perrin (UNITED STATES)

Message: 97427   

 

Hi folks,

 

We are experimenting with CONFIG_ENV_IS_IN_NAND and  u-boot.  However, through the testing process, somehow my environment got corrupted and I got the following error message: 

 

*** Warning - bad CRC or NAND, using default environment

 

Our default boot command is:

 

bootcmd=nboot 0x1000000 0 0x80000;bootm

 

However, in looking at common/env_common.c, it looks like the following code:

 

uchar default_environment[] = {

#ifdef CONFIG_BOOTARGS

"bootargs="    CONFIG_BOOTARGS "\0"

#endif

 

doesn't include any of the NAND boot parameters, such as nandboot and nandargs.  How do we add those to the default environment so a u-boot failure doesn't cause a lockup?

 

Thanks

QuoteReplyEditDelete

 

 

2011-01-13 12:00:43     Re: Environment in NAND, default_environment, and nandboot field

Mike Frysinger (UNITED STATES)

Message: 97429   

 

"nandboot" and "nandargs" are purely end-user conventions.  if you want a default value for "bootcmd", then set CONFIG_BOOTCOMMAND in your board config file like env_command.c shows:

 

#ifdef  CONFIG_BOOTCOMMAND

    "bootcmd="  CONFIG_BOOTCOMMAND      "\0"

#endif

 

and if you want extra vars, use CONFIG_EXTRA_ENV_SETTINGS

QuoteReplyEditDelete

 

 

2011-01-13 12:51:01     Re: Environment in NAND, default_environment, and nandboot field

Reggy Perrin (UNITED STATES)

Message: 97431   

 

Mike,

 

Apologies -- I'm not sure what the issue was, but I can't reproduce this.  It must have been another issue.  I just manually corrupted the two environment locations, rebooted, and it recovered with the correct default environment. 

 

I'll monitor and see if I can reproduce, but looks like this was a false alarm.  Thanks.

Attachments

    Outcomes