avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] avr-libc-1.2.1 and atmega8


From: Joerg Wunsch
Subject: Re: [avr-libc-dev] avr-libc-1.2.1 and atmega8
Date: Mon, 31 Jan 2005 10:23:10 +0100
User-agent: Mutt/1.4.2.1i

As Erik Walthinsen wrote:

> >This is an architecture problem.  __mulhi3 is only defined for avr2
> >and avr3 architectures (old AT90 core that doesn't have hardware
> >multiplication).  If you're trying to link in objects compiled for
> >the old core against a libc.a that has been compiled for a new core
> >(avr4/avr5), you'll get this error.

> I wasn't mixing architectures, ...

Somehow, you did.  Most likely, because you tried to link a libc.a
that has been built for avr2/3 against object files (and a libgcc.a)
that have been built for avr4/5.  As the compiler uses the hardware
multiplication available on avr4/5, the respective libgcc.a doesn't
have a routine for __mulhi3.

> The following code should fail to link for atmega8, with the
> standard debian tools:

> #include <stdio.h>
> int main() {
>   fdevopen(....);
> }

Projects using stdio on the ATmega8 compile fine for me on my FreeBSD
system.  No problem at all, no __mulhi3 used in the resulting object
files.

Eric's WinAVR builds also work as expected.

> In the case of both the atmega32 and the atmega8, MUL/MULS/MULSU are
> part of the chip (avr4) and therefore it *should* work identically
> between the two.  Obviously something is wrong with one of
> binutils/gcc/avr-libc that things atmega8 is a dramatically
> different architecture than the atmega32.

They are different `architectures', in that atmega8 belongs to avr4
(new AVR core, but <= 8 KB ROM so only RJMP/RCALL is needed), while
atmega32 belongs to avr5 (new AVR core, > 8 KB ROM, so JMP/CALL is
needed for jumps/calls outside the current translation unit).

[about Atmel's new STK500 firmware]

As E. Weddington wrote:

> Please note that there is also a method for going back to the
> previous version of the firmware for your AVRISP. It was described
> in a thread on the AVR Freaks website (www.avrfreaks.net). I'm sorry
> I don't have the link right now. But you can easily search for it on
> the forums there.

http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=26060

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]