EmbDev.net

Forum: ARM programming with GCC/GNU tools Linking problem with WinARM/yagarto


Author: Christian Pietsch (beelzebub23)
Posted on:

Rate this post
0 useful
not useful
Hi all,

I'm writing a simple inertial navigation system that should run on a
ARM9 Microcontrollerboard assembled by Olimex. The Controller is an
ATMEL AT91SAM9160. Since I get the basics working, I need to use sinus,
cosine and tangent for further calculations.

But when I implement these parts, the linker throws an error about
undefined references to sinus, cosine and tangent.

I've tested this with WinARM2006, WinARM2008 and yagarto.
When I switch to WinARM2008 and the arm-eabi compiler, the linker throws
also errors like undefined reference to “__eabi_d2f”.

For linking and compiling I used the examples from ATMEL Software
Package for the AT91SAM9160 from this site:
http://www.atmel.com/dyn/products/tools_card.asp?t...
I also had a look in the examples from the WinARM compilation and added
the linking directives from the WinARM examples in the makefile witch I
use.
So the linker and compiler use the libm.a and the math.h from WinARM or
yagarto. I've tested these by renaming them in the directories.

So, what do I have to do, to get these functions work proper?

Kind regards,
Christian

Author: Martin Thomas (mthomas) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Please create a minimal example project to reproduce this (makefile,
linker-script, startup-code, C-sources), pack it intro a zip- or
tgz-archive and attach it to a message here.

Author: Christian Pietsch (beelzebub23)
Posted on:
Attached files:

Rate this post
0 useful
not useful
Here is a minimum example with one sinus function. All files for link
and make included. Hope it will help.

Author: Martin Thomas (mthomas) (Moderator)
Posted on:

Rate this post
0 useful
not useful
Christian Pietsch wrote:
> Here is a minimum example with one sinus function. All files for link
> and make included. Hope it will help.

Try to modfiy the "linker-call"-line in the makefile so $(LDFLAGS) is
the last element and not the one of the firsts.

...
$(CC) -T"$(AT91LIB)/boards/$(BOARD)/$(CHIP)/$$@.lds" -o
$(OUTPUT)-$$@.elf $$^  $(LDFLAGS)
...

If have just tested with CS G++ lite for arm-eabi Version q1-2008 but
this should not matter since I could reproduce the issue with this
package too.

Author: Christian Pietsch (beelzebub23)
Posted on:

Rate this post
0 useful
not useful
Martin Thomas wrote:
> Try to modfiy the "linker-call"-line in the makefile so $(LDFLAGS) is
> the last element and not the one of the firsts.
>
> ...
> $(CC) -T"$(AT91LIB)/boards/$(BOARD)/$(CHIP)/$$@.lds" -o
> $(OUTPUT)-$$@.elf $$^  $(LDFLAGS)
> ...
>
> If have just tested with CS G++ lite for arm-eabi Version q1-2008 but
> this should not matter since I could reproduce the issue with this
> package too.

Yes! It works. Thanks a lot.
Such a little thing, an now it works.

Thousand thanks,
Christian

Reply

Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.