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

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

Re: [avr-gcc-list] Choose where the code is placed in flash memory.


From: Anton Erasmus
Subject: Re: [avr-gcc-list] Choose where the code is placed in flash memory.
Date: Wed, 04 Dec 2002 20:55:42 +0200

On 02/12/03 at 02:18 frantz Capiez wrote:

>Hello,
>
>I want to place myself a portion of my code (like a function), in
>particular address. I use an Atmega16 target with the latest version of
>gcc.
>
> If somedy can write me the method for have this behavior, thank you in
>advance,
>
>
>Frantz
>

Hi,

You can try the following:

void foobar (void) __attribute__ ((section ("bar")));

void foobar(void)
{
  volatile int x;

  x=1;
}                   


In make file add the following to the linker options:
--section-start=bar=0x8000

This will put section bar at 0x8000 and hence function foobar will start
at 0x8000.

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



reply via email to

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