Yahoo Groups archive

Lpc2000

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

Thread

Const string in Flash location with GCC

Const string in Flash location with GCC

2005-07-07 by Ralf Knorr

Hi together,
how can I store a special string in flash at a specific location under 
the Keil\ufffdV3 environment by using the GCC compiler?
With the Keil compiler I can do it with the "_at_" command.
Regards,
Ralf

Re: [lpc2000] Const string in Flash location with GCC

2005-07-07 by 42Bastian Schick

Ralf

> how can I store a special string in flash at a specific location under
> the KeilµV3 environment by using the GCC compiler?
> With the Keil compiler I can do it with the "_at_" command.

use the attribute((__section__("sectionname")))
Then add this section in the linker script.
E.g.:

#define MYSECT __attribute((__section__(".strings")))

MYSECT const char string[] = "Hello";

Linkerscript:

.strings 0x1000 :
{
	*(.strings)
}


-- 
42Bastian Schick

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.