[U-Boot] autoscr command

Hi,
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.
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.
Thanks for any advise.
Kind 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@BEKA-Elektronik.de

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

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@BEKA-Elektronik.de
-----Original Message----- From: Detlev Zundel [mailto:dzu@denx.de] Sent: Friday, July 03, 2009 11:57 AM To: Berns@BEKA-Elektronik.de Cc: u-boot@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@denx.de

Dear "Berns",
In message NDBBKLDECLOIHFJKBINAGECGEKAA.Berns@BEKA-Elektronik.de you wrote:
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.
Can you please submit this as a patch (including your SoB-Line), so we can chek it?
Please see http://www.denx.de/wiki/U-Boot/Patches for details.
Best regards,
Wolfgang Denk

Dear Rainer,
In message NDBBKLDECLOIHFJKBINAGECGEKAA.Berns@BEKA-Elektronik.de you wrote:
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.
I really would like to get this problem fixed. Can you please submit your changes as a patch (including especially your Signed-off-by: line); please see http://www.denx.de/wiki/U-Boot/Patches for details.
Best regards,
Wolfgang Denk
participants (3)
-
Berns
-
Detlev Zundel
-
Wolfgang Denk