--- In lpc2000@yahoogroups.com, "sig5534" <sig5534@h...> wrote:
>
> Thanks sjo. Exactly what I was looking for.
>
> I'm trying to get your last method to would, using the attribute.
> This is what I did for a test function:
>
> void __attribute__((section(".data"))) IAP_Test( void ) {
> U32 N;
> N=IOPIN;
> } // IAP_Test
>
> When I make I get:
>
> main.o(.text+0x150): In function `main':
> /cygdrive/d/GNUARM/Projects/Vader/main.c:96: relocation truncated
to
> fit: R_ARM_PC24 IAP_Test
> collect2: ld returned 1 exit status
> D:\GNUARM\bin\make: *** [vader.elf] Error 1
>
> The line #96 in main is where I put the call to IAP_Test(). GCC is
> taking the attribute, and seems to be doing something with it, but
it
> is giving me this relocation error. I don't know what R_ARM_PC24
is.
>
> Do I need to allocate extra space for this in my startup.s file?
Nice trick of just locating the RAM function in .data.
With main() in flash and IAP_Test() in RAM, they are ~1GB apart, and
a normal BL instruction can only handle distances of up to +/- 32 MB.
Try calling it indirectly:
static void (*pramfunc)(void) = IAP_Test;
(*pramfunc)();
Karl OlsenMessage
Re: How to declare RAM functions in GCC
2005-01-14 by Karl Olsen
Attachments
- No local attachments were found for this message.