Linking problem with WinARM/yagarto

OP #1174511
Rate this post
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?tool_id=4343
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
Moderator #1174514
Rate this post
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.
OP #1174515
Rate this post
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

Please log in before posting.

or

Log in with Google account

Registration is free and takes only a minute.

Register now