[U-Boot-Users] still got "*** Warning - bad CRC, using default environment" after saveenv is sucessfully done

Wayne Lee wnlee at cad.csie.ncku.edu.tw
Mon May 2 16:25:04 CEST 2005


My SoC flash memory logic is poor. (poor hardware)
It only supports 32bit read. That is, 16-bit read and 8-bit read returns
wrong values.
(I wrote a simple bootloader to copy u-boot to RAM for execution at first.)
I found that some hardware-independent fuctions read flash via 8-bit access.
(for example, crc32() and env_relocate_spec()).

Hence, even I really upgrade the environment into dedicated flash sector,
u-boot shows the warning message while booting.

It seems unavoidable to hardcode u-boot.  :)

Thanks.
Wayne

-----Original Message-----
From: wd at denx.de [mailto:wd at denx.de] 
Sent: Monday, May 02, 2005 4:38 PM
To: Wayne Lee
Cc: u-boot-users at lists.sourceforge.net
Subject: Re: [U-Boot-Users] still got "*** Warning - bad CRC, using default
environment" after saveenv is sucessfully done 

In message <200505020725.j427P98R014633 at ismp.csie.ncku.edu.tw> you wrote:
> 
> I have written hardware-dependent flash functions for my EVB u-boot
support.
> Hence, "saveenv" works and I can see the env data in the configured env
> sector by "md" command.
> 
> However, I still get the warning messages, "*** Warning - bad CRC, using
> default environment", after press reset button.

This means that U-Boot does not find a valid environment in flash.

> Should any CONFIG/CFG need to be added in board configuration file?

Added or fixed - how should we know? We don't know your hardware...

> I use u-boot 1.1.2 and the followings are part of board configurations.
> 
> /*-----------------------------------------------------------------------
>  * Physical Memory Map
>  */
> #define CONFIG_NR_DRAM_BANKS	1	   /* we have 1 bank of DRAM */
> #define PHYS_SDRAM_1		0x00000000 /* SDRAM Bank #1 */
> #define PHYS_SDRAM_1_SIZE	0x04000000 /* 64 MB */

You shouldn't do that., You should use auto-sizing instead.

> #define CFG_ENV_IS_IN_FLASH	1
> #define CFG_ENV_SIZE		0x2000	/* Total Size of Environment Sector
> */
> #define CFG_ENV_SECT_SIZE	0x2000
> #define CFG_ENV_OFFSET		0x3F8000	/* environment
starts here
> */
> #define CFG_ENV_ADDR		(CFG_FLASH_BASE + CFG_ENV_OFFSET)

This looks ok  to  me.  I  just  wonder  why  you  provide  redundant
definitions  -  one  of  either  CFG_ENV_OFFSET  or  CFG_ENV_ADDR  is
sufficient.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A man is not complete until he is married -- then he is finished.






More information about the U-Boot mailing list