[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] FPLIB BUG: MEGA128
From: |
Peter Jansen |
Subject: |
Re: [avr-gcc-list] FPLIB BUG: MEGA128 |
Date: |
Wed, 20 Mar 2002 11:16:20 +1100 |
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