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

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

Re: [avr-gcc-list] Query regarding hard located variables


From: avr-gcc
Subject: Re: [avr-gcc-list] Query regarding hard located variables
Date: Wed, 9 Jan 2002 18:04:59 +0100
User-agent: Mutt/1.2.5i
User-agent: Mutt/1.2.5i

address@hidden wrote:

 > ATMega128. This register which I am discussing is not internal to
 > the processor.  It is a bank switching register for the second half
 > of the ATMega128 data space (ie addresses > 0x7fff can be bank
 > switched). Basically, it is located at 0x7fff. We still want to be
 > able to use addresses > 0x7fff for data (and can guarantee that the
 > correct page will be swithed in when necessary)

In that case, write a linker script of your own.  Decrease the amount
of available RAM by one byte, so it'll end up right before 0x7fff.
Invent a hardware memory section and an ELF section of your own for
the single address 0x7fff in the linker script.  Then place your
variable to access the bank switching register into that section.

You need to initialize this variable to your desired value manually at
program startup, gcc's framework will only handle the initialization
of the .bss (to 0) and .data sections (to the values provided as
initializers in the C program).

--
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/
avr-gcc-list at http://avr1.org



reply via email to

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