Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Thread

the address of flash memory

the address of flash memory

2011-12-30 by m_gh77

Hi all
I have a source code as same as this:
flash unsigned char buffer[3]={0xff,0x01,0xff};

if i want to know what is the address of this variable
in my flash memory("SMALL MODEL")

i want to use this address in my program.how can i find it?
thanks

Re: the address of flash memory

2011-12-30 by m_gh77

ok jim but i dont need the first member of array i need address of
array in flash after compiling the program
thanks

Re: the address of flash memory

2011-12-30 by m_gh77

hi
my example is short.the lentgh of my real data is large 
so i should use my data in the flash memory.

Re: [AVR-Chat] the address of flash memory

2011-12-30 by Jim Wagner

pointer? in c, buffer (no index) points to the first member of the array.

Jim Wagner
Oregon Research Electronics.

On Dec 30, 2011, at 1:33 PM, m_gh77 wrote:

> Hi all
> I have a source code as same as this:
> flash unsigned char buffer[3]={0xff,0x01,0xff};
> 
> if i want to know what is the address of this variable
> in my flash memory("SMALL MODEL")
> 
> i want to use this address in my program.how can i find it?
> thanks
> 
> 



[Non-text portions of this message have been removed]

Re: [AVR-Chat] Re: the address of flash memory

2011-12-30 by Jim Wagner

Why is the array in flash? The way you have defined it, it is in SRAM. The data is in flash and is copied into SRAM during boot-up. You access the data through its "image" in SRAM. It is NOT intended for you to access it any other way. Why should  you need to when SRAM has everything?

Jim


On Dec 30, 2011, at 1:50 PM, m_gh77 wrote:

> 
> 
> ok jim but i dont need the first member of array i need address of
> array in flash after compiling the program
> thanks
> 
> 



[Non-text portions of this message have been removed]

Re: [AVR-Chat] Re: the address of flash memory

2011-12-30 by Jim Wagner

Then use pgm_xxx or its "cousins". See avrlibc docs for details.

http://www.nongnu.org/avr-libc/user-manual/pgmspace.html

Jim
On Dec 30, 2011, at 2:04 PM, m_gh77 wrote:

> hi
> my example is short.the lentgh of my real data is large 
> so i should use my data in the flash memory.
> 
> 



[Non-text portions of this message have been removed]

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.