Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Re: gnuarm question

2006-02-11 by G B

That's the ticket!

How can you tell the compiler to put the string in flash?

Glen


Guillermo Prandi wrote:
> Hi, Sean. From tests I did with GCC 4.0.1, I came into the conclusion 
> that:
> 
> char* test1 = "TEST1"; <--- doesn't get copied to RAM
> char  test2[] = {'T','E','S','T','2'}; <--- does get copied to RAM.
> 
> i.e., omiting the const modifier is not enough to make strings be 
> copied to RAM. Strings declared with double quotes are considered 
> const whether we say so or not. There are options to explore besides 
> this. For instance, you can specify the section where you want your 
> variable placed (.text, .data, etc.); I did no tests with that.
> 
> Guille
>

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.