[u-boot] Environment garbled after setenv?

Al Johnson openmoko at mazikeen.demon.co.uk
Mon Dec 8 12:24:45 CET 2008


On Monday 08 December 2008, Evgeniy Karyakin wrote:
> Al Johnson:
> > On Sunday 07 December 2008, Evgeniy Karyakin wrote:
> >> Joachim Breitner:
> >>> AFAIR, the NOR uboot and the NAND uboot don’t share the environment –
> >>> is that right?
> >>
> >>     Then I don't know what "u-boot_env" points to. If we update NAND
> >> environment and then boot with the help of NOR menu, I don't see a
> >> point. Frankly I never tried NAND, maybe I should now.
> >
> > The NOR uboot environment is stored in NOR, and you can't change it
> > unless you have a debug board. This is intentional as the NOR uboot is
> > there to stop you being able to brick your phone, and it wouldn't be much
> > good at that if you could wipe its environment. You should usually be
> > using the NAND uboot which keeps its environment in NAND in the
> > u-boot_env area.
>
>     This explains everything, Al, thanks. So when I use a terminal to
> get into U-Boot console, I interact with NOR machinery, and u-boot_env
> storage is really in NAND field; that makes a point.

There's a bit more to it than that. As I understand it there are two entirely 
separate instances of uboot, each with separate environment storage. You can 
get into the uboot console of either of them, depending on which one you 
start.

NOR: Press and old Aux, then press and hold Power. NOR uboot menu should 
appear in ~2s. Environment is loaded from NOR storage. If you connect to the 
console you can edit the environment for that session, but you can't save the 
changes. This is so you always have a working uboot that will enable you to 
reload the NAND uboot and its environment, or replace it with an alternative 
bootloader such as Qi.

NAND: Press and hold Power then press and hold Aux. NAND uboot menu should 
appear in ~10s. Environment is loaded from NAND storage. If you connect to 
the console you can edit the environment and save the changes back to NAND.

Normal boot (just the power button) uses the default boot option for the NAND 
uboot.





More information about the community mailing list