[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] How to place data in FLASH on GCC 3.2 (avrfreaks)?
From: |
E. Weddington |
Subject: |
Re: [avr-gcc-list] How to place data in FLASH on GCC 3.2 (avrfreaks)? |
Date: |
Wed, 11 Sep 2002 09:24:09 -0600 |
> > "Larry Barello" <address@hidden> wrote:
> >
> > > This works under 3.02 (avrfreaks) but fails on 3.2 (experimental)
> because
> > > the data gets placed in SRAM rather than FLASH.
> > >
> > > #define FLASH __attribute__ ((progmem))
> > > typedef struct
> > > {
> > > ...
> > > } const FLASH SomeStruct;
> > >
> > > SomeStruct MyData = {...};
> > >
> > >
> > > Why?
> >
Larry,
I found that this works:
#define FLASH __attribute__ ((progmem))
typedef struct
{
unsigned char data;
} FLASH const SomeStruct;
SomeStruct MyData = {0x55};
SomeStruct MyData2 = {0xAA};
My map file contains:
.progmem.data 0x0000008c 0x2 base.o
0x0000008d MyData2
0x0000008c MyData
0x0000008e . = ALIGN (0x2)
I use gcc3.2 experimental.
So it looks like you just have to reorder your declaration and it
will work.
Eric
avr-gcc-list at http://avr1.org
- [avr-gcc-list] How to place data in FLASH on GCC 3.2 (avrfreaks)?, Larry Barello, 2002/09/10
- Re: [avr-gcc-list] How to place data in FLASH on GCC 3.2 (avrfreaks)?, Joerg Wunsch, 2002/09/10
- Re: [avr-gcc-list] How to place data in FLASH on GCC 3.2 (avrfreaks)?, Larry Barello, 2002/09/10
- Re: [avr-gcc-list] How to place data in FLASH on GCC 3.2 (avrfreaks)?, E. Weddington, 2002/09/13
- Re: [avr-gcc-list] How to place data in FLASH on GCC 3.2 (avrfreaks)?, Joerg Wunsch, 2002/09/13
- Re: [avr-gcc-list] How to place data in FLASH on GCC 3.2 (avrfreaks)?, E. Weddington, 2002/09/13
- Re: [avr-gcc-list] How to place data in FLASH on GCC 3.2 (avrfreaks)?, Joerg Wunsch, 2002/09/13