[Top][All Lists]

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

RE: [avr-gcc-list] initialized progmem data at fix address

From: Gaël Rossignol
Subject: RE: [avr-gcc-list] initialized progmem data at fix address
Date: Thu, 26 May 2005 15:51:26 +0200


When I use the method under, to declare somme objets in the flash program
memory, I can see the object in the .hex file whith AVR STUDIO 4.11 SP3, but
it dont work whith the .elf file. Is that a bug of AVR STUDIO? 

If I use PROGMEM of the pgmspace.h header that is all correct but the memory
object is placed before program code. Can I put this anywhere?

Thank to answer.

-----Message d'origine-----
De : Eivind Sivertsen [mailto:address@hidden
Envoyé : jeudi 14 avril 2005 10:15
A : Martin Bammer
Cc : address@hidden
Objet : Re: [avr-gcc-list] initialized progmem data at fix address

I dont know if the #pragma option works, but I know you can do this 
(e.g. in your main .c file):

// 1) Define the segment.
#define FLASHDATA __attribute__ ((section (".flashdata")))

// 2) Declare the data array.
const unsigned char data_array[] FLASHDATA = {0xd9, 0xce, 0xe3, ..., 
...etc, etc};

Then add this linker command under the others in the makefile:

LDFLAGS += -Wl,--section-start=.flashdata=0x1E800


>use: #pragma yoursection="ANYNAME"
>then in your makefile write:
>LDFLAGS += -Wl,--section-start=.text=$(ANYNAME_ADDRESS)
>Attention: gcc understands 8000 as BYTE address!
>>how can i create an initialized progmem data at fix address in program
>>flash in C?
>>  ie.: bootloader version number:
>>  uint16_t version;   // at address 0x1E800
>>thanks: Andras
>>AVR-GCC-list mailing list
>AVR-GCC-list mailing list

AVR-GCC-list mailing list

reply via email to

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