--- On Tue, 6/23/09, David Kelly <dke...@hiwaay.net> wrote:

>Something like this might work for you:

>typedef struct {
>    uint8_t variable;
>    uint16_t a, b, c, d;
>    uint32_t e;
>} FLASH_STRUCT;

>#define flash_p ((FLASH_STRUCT *)(0x8000))


Hello David Kelly,

Thanks a lot for taking time to enlighten me on these issues. As you
had suggested to one of my earlier posts,  I created a section and named it 
EXFLASH and put my
variables there, many of them strings. I had a horrid time trying to
find out why a structure defined thus



struct EXFLASH mystruct tempstruct;



had some weird values.  When I checked the map file the named structure
was allotted space in RAM!!!!!! Finally I changed the above to



struct mystruct EXFLASH tempstruct;



and the structure was allotted space in EXFLASH. Phew!!! I finally got the 
struct into FLASH (this will help others in future I guess)

I created one more in RAM and copied the FLASH content to this stuct and able 
to access members witout difficulty. Any pointers on fixed memory allocation 
will really help. Thanks once again to you and Joerg.



Regards,
Nayani P







      
_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to