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

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

Re: [avr-gcc-list] FPLIB BUG: MEGA128


From: Peter Bosscha
Subject: Re: [avr-gcc-list] FPLIB BUG: MEGA128
Date: Wed, 20 Mar 2002 17:52:03 +0200

Hi Again,

Under the heading of: Excuse my ignorance..

Like I said, LPM_R0_ZPLUS_INIT uses a register. 

If going for option 1. the best way would be to write another macro
which somehow works out at what address the relevant table sits and
loads RAMPZ accordingly, after that one can use LPM_R0_ZPLUS_NEXT to
load the data. 
Question is: how do you work out where the table gets linked in ? As
far as I understand, all I can get is a 16 bit address (not 17 bit).

BIG_CODE looks a bit suspicious to me (mine reads 0x10000) shouldn't it
read 0xffff ? 

Peter.

>>> Peter Jansen <address@hidden> 03/20/02 02:16AM >>>
Peter,

> Sorry, I was out of action for a few days.
> I got the linking bit right by swapping:
> 
>     *(.text.*)  and    *(.text)
> 
> libc now sits pretty high up.
> Thanks for that one.
> 
> I tried your suggestion of changing mLPMRdZpp but that ran into the
> problem that ELPM is not defined for the device types under AVR5 (I
> assume your version will work, remember I'm working under windows
which
> is pretty behind on patches).
> 
> Regardless of that little problem: I can think of 3 solutions to
this
> fplib dilemma:
> 
> 1. Reserve an extra register for use inside mLPMRdZpp which then
loads
> rampz. This would mean quite a bit of code changes in all the
routines
> which use this macro. (ouch)

I don't think you need a register in the LPM macro, where this macro
is
used and the Z register is loaded, put 
#if FLASHEND > 0xffff   ; or use BIG_CODE (defined in macros.inc)
        LPM_R0_ZPLUS_INIT (table_atan2)
#endif

Then you would have to do something when the table crosses the
boundary
and Z is set to Z + Rad(lcount)
        
You could fix up the stuff in the fplib so that it uses the macros in
macros.h instead of defining its own.
 
> 2. Make the fplib tables relocatable so that they always load into
the
> lower section of memory (much like the progchar strings in 'c') (how
> does one do that in assembler ?)

Where is this done?

> 3. Tell people to change the linker script so that fplib always
links
> first (ish)

a bit ugly because someone will break it one day.

you could put them in there own section but thats also ugly.

Regards,

-- 
Peter Jansen
KlaxonIQA (formally Smart Container)
Level 1, IBC Building
Garden St
Eveleigh
NSW       1430
AUSTRALIA
Ph 02 9209 4017
avr-gcc-list at http://avr1.org 

avr-gcc-list at http://avr1.org



reply via email to

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