[Top][All Lists]

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

Re: [avr-gcc-list] Re: Larger than 64K memory sections

From: David Kelly
Subject: Re: [avr-gcc-list] Re: Larger than 64K memory sections
Date: Thu, 27 Aug 2009 09:55:05 -0500
User-agent: Mutt/

On Wed, Aug 26, 2009 at 08:21:00PM -0700, Parthasaradhi Nayani wrote:
> David Kelly wrote:
> > You are right that we know nothing about the application in question
> > - details here would make it much easier to give recommendations. 
> Hello all,
> I mentioned 4MB flash as it is the HW spec. This 4MB gets filled over
> a period of time.

4 million bytes or bits? Most FLASH devices are sized by the bit.

> Details of application - I have data packets each 32 bytes in size and
> we have accommodate 2000 of these (predefined).

32 * 2000 = 6400 bytes.

> This I plan to put in a part of the 4MB Flash. Rest of the memory will
> be used for storing records comprising of these data packets with data
> and time etc. The records will be deleted from time to time but the
> data packets will remain. It is possible to use a long int as an
> address pointer from the start of the available memory (after the data
> packets) and store records. I still curious to know how one can create
> a section larger than 64K. 

What you describe is probably best *not* mapped into avr-gcc name space or
AVR address space. Is probably best to #define the starting offsets of
each of your blocks of data.

No matter what you do you won't be able to say *MyUInt16Ptr = 0x1234;
you will have to write a routine and use it something like this:

u16_value = 0x1234;
result = Write4MBFlash( (uint32_t)MyUint16Ptr, sizeof(uint16_t), &u16_value );

All the external SPI FLASH devices I have used are paged. One
read/writes to a RAM buffer in the device then flush that buffer to a
page in FLASH. IIRC the Atmel device I last used had 264 byte pages
which served to complicate addressing if one insisted on using all 264
bytes. Believe the designer's intent was that one use 256 bytes as a
"sector" and the other 8 bytes for tracking usage, even linking to
previous sector and next sector for a form of filesystem.

Atmel had a very useful appnote containing C routines for access to
their DataFlash parts which helped a lot. I felt the need to heavily
edit it for style and naming convention. Rearranged a bit, and deleted a
lot that I didn't use. But it was a very good start.

David Kelly N4HHE, address@hidden
Whom computers would destroy, they must first drive mad.

reply via email to

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