[U-Boot] U-Boot 2010.12 Cannot Successfully Save Variables with Redundant NAND Environment

Alexander Holler holler at ahsoftware.de
Mon Feb 7 11:28:53 CET 2011


Am 06.02.2011 22:33, schrieb Grant Erickson:

>      // Preincrement random data.
>
>      ++env_new.flags; /* increase the serial */
>
> Unfortunately, preincrementing random data won't replicate the behavior of

Wheter using preincrement or postinecrement isn't of interest here, 
using preincrement is just a good habit which will avoid temporaries 
when incrementing complex types in c++. Using always postincrement is a 
bad habit. Just let us call that increment. ;)

But for the random it looks like you are true and I haven't had examined 
the code correctly. I had the believe (and examine the newly saved nand 
here showed that too), that env_new.flags contains the old serial. Must 
have been luck that I've had always the old serial there.

Anyway, increasing the serial there is the right way, it's just that 
flags should already contain the old serial.

> 2010.09, where the flags field was referenced through a global env_ptr such
> that flag manipulation was handled (more) coherently as the environment was
> read and written.

Sorry, I don't know how that worked before. I never have come in touch 
with that before.

Regards,

Alexander


More information about the U-Boot mailing list