avr-gcc-list
[Top][All Lists]
Advanced

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

RE: [avr-gcc-list] Re: eicall & EIND


From: Stu Bell
Subject: RE: [avr-gcc-list] Re: eicall & EIND
Date: Mon, 9 Mar 2009 17:12:35 -0600

*sigh* I need to write a tutorial on this.  It comes up about every 4
months or so.

You *can* reach those functions in upper flash space, but *not* if you
are trying to get there through a function pointer.  All function
pointer targets *must* reside in the bottom 128K flash.  That's because
GCC uses 16 bits to represent pointers and that only addresses the
bottom 128K (64k *words*) of flash.  Don't bother asking to get this
problem fixed in GCC - it's gnarly beyond belief.

The linker is smart enough to use the proper instructions for normal
function calls.  And the linker works for ISRs in upper flash, it turns
out, although I also force all of my ISRs into lower flash, just in
case. Seemed to make the code more stable, don't know why.

I've written in AVR Freaks about how to handle moving things around in
the linker script.  Check there for ATmega2560 and function pointer and
I'm sure you'll run across it.

BTW, my ATmega2560 code is now over 160 Kbytes long.  I am well over the
128K boundary and running with no problems.  With a littl ebit of linker
skill. ;-)

Best regards, 

Stu Bell 
DataPlay (DPHI, Inc.) 

 

> -----Original Message-----
> From: address@hidden 
> [mailto:address@hidden 
> On Behalf Of Dusan Ferbas
> Sent: Monday, March 09, 2009 3:19 PM
> To: Weddington, Eric; address@hidden
> Cc: Andy H
> Subject: RE: [avr-gcc-list] Re: eicall & EIND
> 
> OK, I am not arguing :-).
> I am just adding some strength to this issue, because it is 
> not only a problem of impossibility to reach far code, but 
> problem is also with interrupts, if you manually force eind.
> 
> I also asked about info for trampolines. I was not able to 
> google out, neither find in this list. Any advice ?
> 
> At 18:34 8.3.2009, Weddington, Eric wrote:
> > > in June 2008, I discussed here calling a bootloader from an 
> > > application.
> > > Now, we recognized that this is a common problem with calling 
> > > functions with eicall instruction.
> >
> >Known issue:
> ><http://sourceforge.net/tracker/index.php?func=detail&aid=202
8719&group
> >_id=68108&atid=520074>
> 
> Dusan 
> 
> 
> 
> _______________________________________________
> AVR-GCC-list mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
> 




reply via email to

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