avr-gcc-list
[Top][All Lists]
Advanced

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

RE: [avr-gcc-list] Data pointer, pointing to the flash ROM???


From: Scott and Roxanne Munns
Subject: RE: [avr-gcc-list] Data pointer, pointing to the flash ROM???
Date: Sun, 6 Jul 2003 23:08:19 -0500

Desi,

As an everyday user of the IAR compiler (hoping to someday convince
management to switch
to avr-gcc), I have to use the __flash directive all the time.  I think you
understand the basic operation of it correctly - it means the data is stored
in flash memory, not in RAM.

If you have RAM to burn (or just have a limited number of __flash
variables), I think you could do the following:

#define __flash   const

Then the variables will be type-checked as constants, but be stored (and
accessed) as RAM values instead of flash values.  An added side benefit
would probably be faster access times, since sequences to read values from
flash (LPM/ELPM ops) are pretty slow.

I wish my application allowed me to do this, but I have way more flash data
than available RAM...

Just my two cents worth,
Scott

-----Original Message-----
From: address@hidden
[mailto:address@hidden Behalf Of Desi
Sent: Friday, July 04, 2003 3:37 PM
To: address@hidden
Subject: Re: [avr-gcc-list] Data pointer, pointing to the flash ROM???


> Well, you're quite impatient. ;-)

Sorry, it's my nature...

> I still do want to help you, but haven't yet found the time to
> really look into your butterfly code so far.

Well I have new code, I'll tell yo later where
to down load, because I'd be called not to
attach nothing again, but I will put in some
else place... And yes I still want some help...

> Basically, you'll find the documentation for this in the avr-libc
> docs under ``Program-space strings''.  That's <avr/pgmspace.h>,
> but if you want to go ahead yourself, please do read the docs.

I do read the documentatio, but I'm trying to
find something more explicit, I did try some thing
as

#define __flash __attribute__((progmem))

or some thing like

#define __flash_a  __attribute__((section (".data")))

but i still have the same warnings, and I do
not see the menu yet in the display, but I did
use some of the LCD subrutines and did work fine...

I will read more of the prgspace.h and will try to
desapeer some of the warnings, but by now the code
work like 80% fine, except for the menus...

Regards!!!

Desi.



_______________________________________________
avr-gcc-list mailing list
address@hidden
http://www.avr1.org/mailman/listinfo/avr-gcc-list



reply via email to

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