Using fw_setenv from Linux
Hi Wolfgang,
I am using fw_printenv to set few environment variables from Linux. I am able to see all the environment variables using fw_printenv.
But when i type the command fw_printenv i get the following message first
"*Read error on /dev/mtd1: Success*"
then u-boot environment variables are printed.
After creating a softlink from fw_setenv to fw_printenv i executed the
following command to set boot delay as 8 .
On execution of following command *fw_setenv bootdelay 9 *i got the following print messages.
*Read error on /dev/mtd1: Success
Unlocking flash...
Done
Erasing old environment...
Done
Writing environment to /dev/mtd1...
Write error on /dev/mtd1: Operation not supported
Error: can't write fw_env to flash
*
What might be the problem here?
But after fw-setenv command if i give a fw_printenv command it shows modified boot delay value..
And then when i reboot the system i get boot failed message and uboot does not come up.
Thanks
Rahanesh
Dear Rahanesh,
Quoted 5 lines · In message <[email protected]> you wrote:
But when i type the command
fw_printenvi get the following message first"*Read error on
/dev/mtd1: Success*"
then u-boot environment variables are printed.
I gave up trying to reply to your questions. You supply _zero_ information. We don't know which board this is, which exact version of U-Boot you are running on it, which modifications you made to the code you are running, how you configured and built U-Boot for this board, what the MTD configuration in your Linux kernel is, nor how you set up the fw_env configuration file, etc. etc. etc.
You must not expect any help without providing essential information. I explained this to you before here:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/64344
and here:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/68424A
and again here:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/68521
All you told us was that you are running some heavily modified code based on a 5 year old version of U-Boot.
I then told you that we will not waste efforts in supporting such old code.
No matter how often you will ask the same questions again: we _cannot_ help you in this situation.
Update and use current code, please. If you cannot do this yourself, then hire someone who can. Please feel free to drop me a note when you need help with this, but note that this help will not be available for free.
Also, reading http://catb.org/esr/faqs/smart-questions.html might be beneficial to you.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de To understand a program you must become both the machine and the program.
Dear Wolfagng,
Quoted 10 lines · Wolfgang Denk
Dear Rahanesh,
Quoted 5 lines · In message <[email protected]> you wrote:
But when i type the command
fw_printenvi get the following message first"*Read error on
/dev/mtd1: Success*"
then u-boot environment variables are printed.
Quoted 7 lines
I gave up trying to reply to your questions. You supply _zero_ information. We don't know which board this is, which exact version of U-Boot you are running on it, which modifications you made to the code you are running, how you configured and built U-Boot for this board, what the MTD configuration in your Linux kernel is, nor how you set up the
fw_envconfiguration file, etc. etc. etc.
I am trying to give as much information as possible.
This is mips processor based A100 board. Uboot version is uboot 1.2.
There are no modifications to u-boot code as such.
These are the MTD configurations in Linux kernel.
MTD0 - Firmware + U-Boot + Environment variables of u-boot
MTD1- JFFS (Linux + Apps)
MTD1 - CONFIG
fw_env.config file is shown below
# MTD device name Device offset Env. size Flash sector size
Number of sectors
/dev/mtd0 0x3F000 0x1000 0x1000
When i use this configuration file i am able to see all environment
variables from Linux. even setting Environment variables also was success.
But when i reboot the system to see the modified changes i get a
boot failed message.
Thanks
Rahanesh
Dear Rahanesh,
Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 8 lines
I gave up trying to reply to your questions. You supply _zero_ information. We don't know which board this is, which exact version of U-Boot you are running on it, which modifications you made to the code you are running, how you configured and built U-Boot for this board, what the MTD configuration in your Linux kernel is, nor how you set up the
fw_envconfiguration file, etc. etc. etc.
Quoted 4 lines
I am trying to give as much information as possible.
This is mips processor based A100 board. Uboot version is uboot 1.2.
There are no modifications to u-boot code as such.
Yes, of course there are. You mentioned (and profed this by showing debug messages) that you were using some file 'sflash.c' which definitly is NOT part of the mainline U-Boot code.
Quoted 5 lines
When i use this configuration file i am able to see all environment
variables from Linux. even setting Environment variables also was success.But when i reboot the system to see the modified changes i get a
boot failed message.
You cannot say "setting Environment variables also was success", then, if it actually corrupts your flash.
Sorry, we cannot help you. Please use a current version.
Note that this is my very last message to you on this topic.
Wolfgang Denk
Signature · 6 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It is impractical for the standard to attempt to constrain the
behavior of code that does not obey the constraints of the standard.
- Doug Gwyn