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

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

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


From: Torsten Mohr
Subject: Fwd: [avr-gcc-list] Query regarding hard located variables
Date: Mon, 7 Jan 2002 18:46:09 +0100

Hi,

normally this is not the way to declare HW registers
at fixed addresses, i know it ike this:

#define HW_REGISTER    (*((char*)0xff1234))

Now you can access HW_REGISTER and read/write from/to it.

Take the address of the register, cast it to a pointer to
a char (if the register size is 8 bit) and dereference it
with a "*".


Regards,
Torsten.


----------  Weitergeleitete Nachricht  ----------

Subject: [avr-gcc-list] Query regarding hard located variables
Date: Mon, 07 Jan 2002 13:33:05 +1100
From: Scott Finneran <address@hidden>
To: avr-gcc-list <address@hidden>

Hello All,

I would have thought that the following would be a more commonly asked
(and therefore answered) question. I can only assume that I am searching
for the info in the wrong place or using the wrong keywords. If so, then
I apologise in advance.

I would like to know how to hard locate a variable using gcc and/or the
gnu linker. The hardware that I am using has a number of memory mapped
hardware registers. Obviously I would like to avoid having the linker
drop variables into memory addresses where these registers live. It
would also be nice to be able have variables (of my choosing) be located
at these addresses. Of course the latter can be easily achieved with a
pointer. Many commercial embedded compilers provide a compiler specific
directive such as:
eg int reg1 _at(0x4000);

Others simply allow you to specify the location of specific variables in
linker scripts.

I have seen many websites and articles (eg from embedded.com) talk about
doing this. Many more say that it is possible. None of them (that I have
found) say how, or even better give an example.

Can anyone point me to some info or alternatively show me how this is
done?

Kind Regards,

Scott Finneran
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]