[U-Boot] autoscr command failure saveenv dataflash
Berns
Berns at BEKA-Elektronik.de
Mon Sep 7 13:54:02 CEST 2009
Hi,
the reason for this problem is the definition of
#define DATAFLASH_BUSY 0x00
#define DATAFLASH_OK 0x01
in the file /include/dataflash.h.
All functions return DATAFLASH_OK and in the file /common/cmd_nvedit.c
function do_saveenv()
return (saveenv() ? 1 : 0);
than cause an error.
I have modified it to return (saveenv() == 1 ? 0 : 1);
and this works for my, but i'am not sure if this is the best way of fixing
the problem.
Regards
Rainer Berns
BEKA Elektronik
Rainer Berns & Rudolf Kauls GbR
Siemensstrasse 29
50374 Erftstadt
Tel.: +49 2235/4606-0
Fax.: +49 2235/4606-29
Email: Berns at BEKA-Elektronik.de
-----Original Message-----
From: Detlev Zundel [mailto:dzu at denx.de]
Sent: Friday, July 03, 2009 11:57 AM
To: Berns at BEKA-Elektronik.de
Cc: u-boot at lists.denx.de
Subject: Re: [U-Boot] autoscr command
Hi Rainer,
> i use the autoscr command to store further information in a NAND at the
> first start.
> After this it modify the bootcmd and save the enviroment and the last
> command should restart the device.
Where is your environment located? What parser do you use,
i.e. "regular" or "hush"?
> The script works fine but "saveenv" seams to abort the script file.
> I have used different memory location, i have checked the memory contents
> and i have placed saveenv at the beginning, middle and at the end of the
> script.
> It allways abort after "saveenv".
> I use Uboot 2008.10.
I presume there is a bad return code somewhere. If you have the
hush-parser enebled, try this for a start:
=> if saveenv ; then echo ok ; else echo failed ; fi
Saving Environment to Flash...
Un-Protected 2 sectors
Un-Protected 2 sectors
Erasing Flash...
.. done
Erased 2 sectors
Writing to Flash... done
Protected 2 sectors
Protected 2 sectors
ok
=>
Cheers
Detlev
--
I shall be telling this with a sigh / Somewhere ages and ages hence: /
Two roads diverged in a wood, and I-- / I took the one less traveled by, /
And that has made all the difference. -- Robert Frost
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de
More information about the U-Boot
mailing list