Totally wrecked my ENV

Hi there,
while trying to set the mac-address of a device in u-boot I somehow wrecked the whole thing.
I think I did 'setenv eth0addr xx:xx:xx:xx:xx:xx' followed by 'saveenv' After that, my device tells me "Unknown command 'run' - try 'help'" and also "Unknown command 'env' - try 'help'"
printenv is also unknown
After several reboots, even 'printenv' is not known. In previous boots, I could do 'printenv' an truly there were some weird outputs.....
I seemed to me that some wrong quoting in the above 'setenv' command messed up all the strings.
I'm lost now, how can I achienve a total reset of my ENV?
The board is a riotboard with U-Boot 2019.01, which I build/installed myself (ages ago)
Any help is highly appreciated.
Thanks, udo.

Dear Udo,
In message a70e84c8-506b-f61f-2884-0798a43cecc3@zoide.net you wrote:
while trying to set the mac-address of a device in u-boot I somehow wrecked the whole thing.
I think I did 'setenv eth0addr xx:xx:xx:xx:xx:xx' followed by 'saveenv' After that, my device tells me "Unknown command 'run' - try 'help'" and also "Unknown command 'env' - try 'help'"
I can't imagine of a situation where a correctly running U-Boot would suffer in such a way from any misspelled environment settings.
I seemed to me that some wrong quoting in the above 'setenv' command messed up all the strings.
No, the cause of the problem must be elsewhere.
I'm lost now, how can I achienve a total reset of my ENV?
Resetting your environment will not help. When U-Boot cannot find command names like run or printenv, it's internal data stuctures have been corrupted, and this will not go away if you clean up the environment. You must reflash the whole U-Boot image. If you can still boot into Linux, I would use this to write the new U-Boot image, as you cannot really trust your U-Boot any more. If not, and you can still load and flash an image in U-Boot, then try that. If this doesn't work either, then you probably have to use a JTAG debugger (if you have a JTAG connector on your board).
Best regards,
Wolfgang Denk

Thank you very much Wolfgang,
reinstalling U-Boot helped.
Cheers, udo.
On 24/03/2020 15:18, Wolfgang Denk wrote:
Dear Udo,
In message a70e84c8-506b-f61f-2884-0798a43cecc3@zoide.net you wrote:
while trying to set the mac-address of a device in u-boot I somehow wrecked the whole thing.
I think I did 'setenv eth0addr xx:xx:xx:xx:xx:xx' followed by 'saveenv' After that, my device tells me "Unknown command 'run' - try 'help'" and also "Unknown command 'env' - try 'help'"
I can't imagine of a situation where a correctly running U-Boot would suffer in such a way from any misspelled environment settings.
I seemed to me that some wrong quoting in the above 'setenv' command messed up all the strings.
No, the cause of the problem must be elsewhere.
I'm lost now, how can I achienve a total reset of my ENV?
Resetting your environment will not help. When U-Boot cannot find command names like run or printenv, it's internal data stuctures have been corrupted, and this will not go away if you clean up the environment. You must reflash the whole U-Boot image. If you can still boot into Linux, I would use this to write the new U-Boot image, as you cannot really trust your U-Boot any more. If not, and you can still load and flash an image in U-Boot, then try that. If this doesn't work either, then you probably have to use a JTAG debugger (if you have a JTAG connector on your board).
Best regards,
Wolfgang Denk
participants (2)
-
Udo Waechter
-
Wolfgang Denk