* RE: How to declare an array of constants to be stored in FLASH only
@ 2005-10-03 21:46 Steven L. Zook
0 siblings, 0 replies; 2+ messages in thread
From: Steven L. Zook @ 2005-10-03 21:46 UTC (permalink / raw)
To: Jeff Krueger, gcc-help; +Cc: dmgarske
Look at __attribute__(section("section_name")) in conjunction with the
linker file to achieve what you're after.
-----Original Message-----
From: gcc-help-owner@gcc.gnu.org [mailto:gcc-help-owner@gcc.gnu.org] On
Behalf Of Jeff Krueger
Sent: Monday, October 03, 2005 2:03 PM
To: gcc-help@gcc.gnu.org
Cc: dmgarske@yahoo.com
Subject: How to declare an array of constants to be stored in FLASH only
I am using the GCC compiler for an Atmel ATMEGA128 target.
I would like to declare a large array of constants so that it is
accessible from FLASH and does not use RAM.
static const unsigned char Data[] = {0x45, 0x23, .....} The above seems
to copy the constant data into RAM Is there a way to declare the above
array so that it does not create an initialized data in RAM I was able
to do this with a different compiler/linker with the __flash keyword
static const __flash unsigned char Data[] = {0x45, 0x23, .....} Thanks
in advance, Jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
* How to declare an array of constants to be stored in FLASH only
@ 2005-10-03 21:03 Jeff Krueger
0 siblings, 0 replies; 2+ messages in thread
From: Jeff Krueger @ 2005-10-03 21:03 UTC (permalink / raw)
To: gcc-help; +Cc: dmgarske
I am using the GCC compiler for an Atmel ATMEGA128 target.
I would like to declare a large array of constants so that it is accessible from FLASH and does not use RAM.
static const unsigned char Data[] = {0x45, 0x23, .....}
The above seems to copy the constant data into RAM
Is there a way to declare the above array so that it does not create an initialized data in RAM
I was able to do this with a different compiler/linker with the __flash keyword
static const __flash unsigned char Data[] = {0x45, 0x23, .....}
Thanks in advance,
Jeff
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-10-03 21:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-03 21:46 How to declare an array of constants to be stored in FLASH only Steven L. Zook
-- strict thread matches above, loose matches on Subject: below --
2005-10-03 21:03 Jeff Krueger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).