[Top][All Lists]

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

Re: [avr-gcc-list] String Arrays in FLASH & gccavr 3.0

From: Jason Kyle
Subject: Re: [avr-gcc-list] String Arrays in FLASH & gccavr 3.0
Date: Fri, 10 Aug 2001 22:27:26 +1200

Have a look at the eAVR project test programs for some examples



Jason Kyle

At 11:13 7/08/2001 +0930, address@hidden wrote:

I am wondering if anyone has a better method of defining arrays of null
terminated strings in FLASH.   With the additional overhead of reading
constant byte data from FLASH, reading pointers to strings in FLASH does
present some difficulty.   It is easy to write a macro to do the two byte
to pointer conversion, what I am having trouble with is *forcing* gcc 3.0
to put the pointer (address) in FLASH and not define it as constant data in
RAM.   Defining my constant strings such;

static __attribute__ ((progmem)) char* F_strings[] =

Results in the whole lot being placed in RAM, seems to ignore the attribute
directive.   Change it thus;

static __attribute__ ((progmem)) char c_string1[] = "Menu1";
static __attribute__ ((progmem)) char c_string2[] = "Menu2";
static __attribute__ ((progmem)) char c_string3[] = "Menu3";

static __attribute__ ((progmem)) char* F_strings[] =

Results in c_string1,2 &3 being placed in FLASH, but F_strings is still
retained in RAM (still ignores attribute), albeit this much smaller than
the first case.   Now how can I force the compiler to put F_strings[] in
FLASH aswell so I can point my macros at them ?   I am sure this is a
problem with my limited understanding of gccavr, I have done this
previously with Hitachi and a PC, but on those projects I didn't care if my
pointers and string data were in RAM or ROM.   Any clues ?


reply via email to

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