2009-05-05 14:40:19     Question about how enviroment works

Document created by Aaronwu Employee on Sep 18, 2013
Version 1Show Document
  • View in full screen mode

2009-05-05 14:40:19     Question about how enviroment works

Jay Ku (UNITED STATES)

Message: 73691   

 

I'm confused about how the enviroment works in u-boot.  The following log shows what I mean:

 

bfin> printenv

baudrate=57600

ethaddr=02:80:ad:20:31:b8

hostname=bfin

loadaddr=0x1000000

filesize=1E2D8

fileaddr=100000

gatewayip=192.168.1.1

netmask=255.255.255.0

ipaddr=192.168.1.111

serverip=192.168.1.5

stdin=serial

stdout=serial

stderr=serial

 

Environment size: 233/65532 bytes

bfin> print serverip

serverip=192.168.1.5

bfin> tftp 0x100000 README

smc911x: initializing

smc911x: detected LAN9215 controller

smc911x: phy initialized

smc911x: MAC 02:80:ad:20:31:b8

*** ERROR: `serverip' not set

bfin> set serverip 192.168.1.5

bfin> tftp 0x100000 README

smc911x: initializing

smc911x: detected LAN9215 controller

smc911x: phy initialized

smc911x: MAC 02:80:ad:20:31:b8

TFTP from server 192.168.1.5; our IP address is 192.168.1.111

Filename 'README'.

Load address: 0x100000

Loading: #########

done

Bytes transferred = 123608 (1e2d8 hex)

bfin> printenv

baudrate=57600

ethaddr=02:80:ad:20:31:b8

hostname=carui

loadaddr=0x1000000

stdin=serial

stdout=serial

stderr=serial

filesize=1E2D8

fileaddr=100000

gatewayip=192.168.1.1

netmask=255.255.255.0

ipaddr=192.168.1.111

serverip=192.168.1.5

 

Environment size: 233/65532 bytes

bfin>

 

Even though 'serverip' is in the enviroment (as shown by 'printenv' and 'print serverip'), tftp can't find it until I do a 'set serverip'.  I thought the enviroment was read out of flash into a RAM buffer at startup and then all changes (and accesses) were in RAM until 'saveenv' is used to copy these to flash.  Do I have this wrong?

QuoteReplyEditDelete

 

 

2009-05-05 15:45:09     Re: Question about how enviroment works

Robin Getz (UNITED STATES)

Message: 73695   

 

Jay:

 

If you do a "save" and a "reset" - does that same thing happen? It could be a excape char in the "serverip" name.

 

-Robin

QuoteReplyEditDelete

 

 

2009-05-05 16:27:39     Re: Question about how enviroment works

Mike Frysinger (UNITED STATES)

Message: 73701   

 

what version of u-boot exactly are you using ?

QuoteReplyEditDelete

 

 

2009-05-05 19:00:49     Re: Question about how enviroment works

Jay Ku (UNITED STATES)

Message: 73717   

 

Problably that was it, Robin - I just saved and reset and it's ok now - maybe there was some hidden character in there.  If that were the case, strange that printenv was reporting the same length both times (unless it's only counting printable characters).

 

I'm using 2009.03-svn1860 (ADI-2009R2-pre) u-boot.

QuoteReplyEditDelete

 

 

2009-05-05 19:08:12     Re: Question about how enviroment works

Mike Frysinger (UNITED STATES)

Message: 73718   

 

there is a patch for 2009.03 related to tftp and env handling upstream, but it hasnt been merged yet

 

if you do:

unset serverip

save

reset

set serverip 192.168.1.15

tftp .....

 

does it still fail ?

QuoteReplyEditDelete

 

 

2009-05-08 15:32:44     Re: Question about how enviroment works

Jay Ku (UNITED STATES)

Message: 73899   

 

that worked (I don't have an 'unset' command, but 'set serverip' does the same thing)

Attachments

    Outcomes