u-boot environment corruption

Started by oldpenguin, November 04, 2013, 08:35:50 PM

Previous topic - Next topic

oldpenguin

Hello
I don't know if anyone has ever tried this.
During my tests with nand flash partitioning, I wanted to change some u-boot environment variables and make them persistent (store in flash). The problem is as soon as I issue the "saveenv" in u-boot, the environment memory gets corrupted and I get the dreadful "*** Warning - bad CRC, using default environment" at start plus the environment is reset to some useless defaults.
I am using u-boot from sunxi-bsp and loading the image with livesuit.

Any solution ?
Is u-boot environment hard-coded to some memory position ?


oldpenguin

Hi
I did not find any solution for the environment persistence/corruption.

Apparently, the only way to customize the boot-up process is to compile your own u-boot and hard-code the wanted commands.
I did manage to do that following several threads around these forums.

Another way to configure u-boot in other projects is by using an external file Boot.scr.

Does any one know if this file is supported in this version of u-boot ?

davidefa

I use a boot.scr on an sd with a olimex debian and it works.
That same boot.scr is ignored by the uboot on nand ( I have flashed on nand a debian image someone posted in another thread )

oldpenguin

Thanks for your feedback
I don't understand why they should be so different.
Maybe its just some compilation options, or maybe both methods just can't be used simultaneously (script.bin AND Boot.scr)
I will have to check the source code, and will post back my findings.