[U-Boot-Users] Re: environmental variable corruption on dataflash

Wolfgang Denk wd at denx.de
Wed Mar 23 22:08:21 CET 2005

In message <loom.20050322T145047-28 at post.gmane.org> you wrote:
> > Run a "md" command over your environment area and you  will  probably
> > see what happened.
> Yep, you are right. It is because of control chars:
> ....................
> c0020000: e96454c3 746f6f62 616c6564 00333d79    .Td.bootdelay=3.
> c0020010: 64756162 65746172 3531313d 00303032    baudrate=115200.
> c0020020: 746f6f62 656c6966 6d49753d 00656761    bootfile=uImage.
> c0020030: 6470756b 3d657461 70746674 31303220    kupdate=tftp 201
> c0020040: 30303030 49752030 6567616d 1b445b1b    00000 uImage.[D.
> c0020050: 5b1b445b 445b1b44 1b445b1b 5b1b445b    [D.[D.[D.[D.[D.[
> c0020060: 445b1b44 1b445b1b 5b1b445b 445b1b44    D.[D.[D.[D.[D.[D
> c0020070: 1b445b1b 5b1b445b 445b1b44 1b445b1b    .[D.[D.[D.[D.[D.
> c0020080: 5b1b445b 445b1b44 72445b1b 6f645f6e    [D.[D.[D.[Drn_do
> c0020090: 6f6c6e77 5b1b6461 435b1b43 1b435b1b    wnload.[C.[C.[C.
> c00200a0: 5b1b435b 6c660043 32687361 3d6e726b    [C.[C.flash2krn=
> c00200b0: 622e7063 30306320 30303832 30322030    cp.b c0028000 20
> c00200c0: 30303031 31203030 30303030 656e0030    100000 100000.ne
> .....................
> Is there a way to get rid of the bad entries without bulk erasing 
> a flash sector?

In this case the control characters are in the value of the  variable
only - it should be trival to delete or redefine it.

If you have control character in the name of a variable,  and  cannot
figure  out  how  to  enter  thise  at  teh command line, than indeed
erasing the whole environment is the fastest method to clean up.

[If you get used to either providing  a  useful  default  environment
and/or  using  a  "shell  script"  to set the environment values then
restoring a sane state is just a matter of a few seconds.]

Best regards,

Wolfgang Denk

Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
In any group of employed individuals the only naturally  early  riser
is  _always_  the office manager, who will _always_ leave reproachful
little notes ... on the desks of their subordinates.
                                - Terry Pratchett, _Lords and Ladies_

More information about the U-Boot mailing list