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

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

Re: [avr-gcc-list] AVR-GCC question


From: Parthasaradhi Nayani
Subject: Re: [avr-gcc-list] AVR-GCC question
Date: Fri, 20 May 2005 06:09:09 -0700 (PDT)

Hello James,

Even under normal circumstances strings ARE stored in
flash and are copied by the startup code into RAM.
This means that you actually have two copies of the
same string, one in flash and the other in ram which
your programme accesses. Therefore the best method is
to store the strings in flash and access them as and
when needed. This will also freeup ram which is a
premium specially in small controllers such as the
Mega8 etc.

Regards
Nayani



--- "James A. Kinnard" <address@hidden> wrote:
> I first want to say thanks to all those on this list
> who have contributed to
> the development of AVR-GCC.  You've done a fine job.
> 
> My question is related to the dreaded "Strings in
> Flash" issue.  I have read
> all of the documentation and most of the postings on
> this list and I
> understand the published techniques available for
> handling this issue.  My
> situation is this: I am porting an existing
> application (written for the
> ImageCraft compiler) which has several HUNDRED
> string literals ("MyString")
> which are largely defined on-the-fly as function
> arguments.  ImageCraft has
> a global compiler option to place these strings in
> FLASH, as I'm guessing
> that IAR does as well from the postings I've read. 
> The best option that it
> seems I have to port this application using AVR-GCC
> is to use the PSTR(s)
> macro around EACH of these string literals in order
> to force the compiler to
> place them into FLASH and ONLY FLASH.  I can define
> a null PSTR(s) to
> maintain backward compatibility with ImageCraft,
> which I must have.  Is this
> the best option I have or is there something in the
> documentation I have
> missed?
> 
> Is there a plan to add the 'global string literals
> in FLASH' option to a
> future release of AVR-GCC?
> 
> Thanks in advance!
> 
> James Kinnard
> Adaptive Solutions
> 
> 
> 
> _______________________________________________
> AVR-GCC-list mailing list
> address@hidden
>
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
> 


                
Discover Yahoo! 
Get on-the-go sports scores, stock quotes, news and more. Check it out! 
http://discover.yahoo.com/mobile.html




reply via email to

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