[Top][All Lists]

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

Re: [avr-gcc-list] Memory problem

From: Parthasaradhi Nayani
Subject: Re: [avr-gcc-list] Memory problem
Date: Tue, 23 Jun 2009 08:38:04 -0700 (PDT)

--- On Tue, 6/23/09, David Kelly <address@hidden> wrote:

>Something like this might work for you:

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

>#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.

Nayani P

reply via email to

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