public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Resend: The dreaded embedded environment - linker barf!
@ 2003-08-25 20:47 Robin Gilks
  2003-08-27 12:24 ` Wolfgang Denk
  0 siblings, 1 reply; 4+ messages in thread
From: Robin Gilks @ 2003-08-25 20:47 UTC (permalink / raw)
  To: u-boot

Greetings

Well what a suprise!! I've been struck by the environment mapping yet 
again!.

If I change my memory map for 'top' booting I *should* just need to set 
the TEXT_BASE address to threequarters up my 4M flash device (so it 
starts at 0xfff00000), set the CFG_MONITOR_BASE to the same and leave 
CFG_FLASH_BASE where it is along with all other address config items.

Unfortunately the linker barfs on the embedded environment value which 
is defined as an offset into the image (well, actually the flash 
according to the code). Setting it as CFG_ENV_OFFSET or CFG_ENV_ADDR 
makes no difference (so I can't put it at the start of the flash outside 
the image either).

The error message from the linker is:
u-boot.lds:132 invalid assignment to location counter
- the line number refering to the line after the closing brace for the 
whole file which doesn't help much!!

It looks as though the CFG_FLASH_BASE define is being used 
inappropriately where CFG_MONITOR_BASE would be a more sensible value 
(for example to see if the environment is embedded should depend on 
where in flash that u-boot image is, not where the flash starts!!)

Any ideas appreciated!

-- 
Robin Gilks
Senior Design Engineer          Phone: (+64)(3) 357 1569
Tait Electronics                Fax  :  (+64)(3) 359 4632
PO Box 1645 Christchurch        Email : robin.gilks at tait.co.nz
New Zealand

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] Resend: The dreaded embedded environment - linker barf!
  2003-08-25 20:47 Robin Gilks
@ 2003-08-27 12:24 ` Wolfgang Denk
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2003-08-27 12:24 UTC (permalink / raw)
  To: u-boot

Dear Robin,

in message <3F4A75FC.7020907@tait.co.nz> you wrote:
> 
> If I change my memory map for 'top' booting I *should* just need to set 

What do you mean with "should" here? Is this what  you  think  should
happen? Maybe your expectations do not match the reality given by the
current implementation / configuration.

> It looks as though the CFG_FLASH_BASE define is being used 
> inappropriately where CFG_MONITOR_BASE would be a more sensible value 
> (for example to see if the environment is embedded should depend on 
> where in flash that u-boot image is, not where the flash starts!!)

These defines are used all fine, as long as your configuration  makes
sense (as demonstrated by the 100+ existing board configurations).

> Any ideas appreciated!

Try to  understand  what  the  image  should  look  like,  where  the
environment  is located, and which #defines are used to configure the
environment to that location.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
365 Days of drinking Lo-Cal beer.                       = 1 Lite-year

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] Resend: The dreaded embedded environment - linker barf!]
@ 2003-08-27 21:54 Robin Gilks
  0 siblings, 0 replies; 4+ messages in thread
From: Robin Gilks @ 2003-08-27 21:54 UTC (permalink / raw)
  To: u-boot

Wolfgang Denk wrote:
> Dear Robin,
> 
> in message <3F4A75FC.7020907@tait.co.nz> you wrote:
> 
>>If I change my memory map for 'top' booting I *should* just need to set 
> 
> 
> What do you mean with "should" here? Is this what  you  think  should
> happen? Maybe your expectations do not match the reality given by the
> current implementation / configuration.

My assumptions here are based in part on the names of the #defines

> 
>>It looks as though the CFG_FLASH_BASE define is being used 
>>inappropriately where CFG_MONITOR_BASE would be a more sensible value 
>>(for example to see if the environment is embedded should depend on 
>>where in flash that u-boot image is, not where the flash starts!!)
> 
> 
> These defines are used all fine, as long as your configuration  makes
> sense (as demonstrated by the 100+ existing board configurations).

It was only later I re-read the README file where it states that
CFG_MONITOR_START = CFG_FLASH_BASE - makes one of them somewhat
redundant if they are equal anyway. Certainly it appears that the code
assumes they are the same!!

>>Any ideas appreciated!
> 
> 
> Try to  understand  what  the  image  should  look  like,  where  the
> environment  is located, and which #defines are used to configure the
> environment to that location.

I fixed the problem by putting the environment into EEPROM - the FLASH
implementation is broken. If it happens that I have to revisit the FLASH
environment then I'll try and fix it :-))


-- 
Robin Gilks
Senior Design Engineer          Phone: (+64)(3) 357 1569
Tait Electronics                Fax  :  (+64)(3) 359 4632
PO Box 1645 Christchurch        Email : robin.gilks at tait.co.nz
New Zealand

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot-Users] Resend: The dreaded embedded environment - linker barf!
       [not found] <3F4D26AE.5050103@tait.co.nz>
@ 2003-08-28  7:35 ` Wolfgang Denk
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfgang Denk @ 2003-08-28  7:35 UTC (permalink / raw)
  To: u-boot

Dear Robin,

in message <3F4D26AE.5050103@tait.co.nz> you wrote:
>
> My assumptions here are based in part on the names of the #defines

This is not a reliable method - if there is no  better  documentation
you have to check how these #define'd variables are _used_, too.

> It was only later I re-read the README file where it states that 
> CFG_MONITOR_START = CFG_FLASH_BASE - makes one of them somewhat 
> redundant if they are equal anyway. Certainly it appears that the code 
> assumes they are the same!!

This is not exactly correct. The README says about  CFG_MONITOR_BASE:
"same  as  CFG_FLASH_BASE  when  booting  from  flash." In some cases
U-Boot may  be  stored  in  ROM,  or  even  in  RAM,  in  which  case
CFG_MONITOR_BASE and CFG_FLASH_BASE may be different.

> I fixed the problem by putting the environment into EEPROM - the FLASH 
> implementation is broken. If it happens that I have to revisit the FLASH 
> environment then I'll try and fix it :-))

No, the flash implementation is _NOT_ broken. Your  configuration  is
broken, that's all. The flash implementation is working fine on many,
many boards.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-4596-87  Fax: (+49)-8142-4596-88  Email: wd at denx.de
Far back in the mists of ancient time, in the great and glorious days
of the former Galactic Empire, life was wild, rich  and  largely  tax
free.         - Douglas Adams, _The Hitchhiker's Guide to the Galaxy_

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-08-28  7:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-27 21:54 [U-Boot-Users] Resend: The dreaded embedded environment - linker barf!] Robin Gilks
     [not found] <3F4D26AE.5050103@tait.co.nz>
2003-08-28  7:35 ` [U-Boot-Users] Resend: The dreaded embedded environment - linker barf! Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2003-08-25 20:47 Robin Gilks
2003-08-27 12:24 ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox