[Top][All Lists]

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

RE: [avr-gcc-list] "progmem_far" attribute

From: Stu Bell
Subject: RE: [avr-gcc-list] "progmem_far" attribute
Date: Fri, 2 May 2008 11:38:01 -0600

Hi Anatoly,

"This restriction was rare a source of problem for 128K devices but is
very hard for 256K and up devices." 

Actually, this is a source of problems for any device larger than 64K.
The PROGMEM pointer is a byte pointer, not a word pointer, so 64K is the
break.  Of course, one needs to have code as well, so your original
comment may be right!

As far as the attribute goes, it sounds good to me.

Best regards, 

Stu Bell 
DataPlay (DPHI, Inc.) 

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of
Anatoly Sokolov
Sent: Friday, May 02, 2008 10:36 AM
To: avr-GCC
Subject: [avr-gcc-list] "progmem_far" attribute


  Now GCC have "progmem" attribute to place data in the '.progmem'
The 'avr-libc' have set of '*_P' string functions for access to
data. But pointer operand in  '*_P' functions is 16-bit size and hence
size of data in  '.progmem' section it is limited by about 64KB.

  This restriction was rare a source of problem for 128K devices but is
very hard for 256K and up devices.

  I suggest to add "progmem_far" attribute, and place data defined with
it attribute in the new '.progmem_far' section place it in end of
section after ".fini0" (It is some section which should be located in
low 128K ".trampolines*" and ".lowtext*"). For access to data in this
section to use set of  '*_PF' string functions (patch #6352: Far pointer

  Now the programmer can define often used data with "progmem" attribute
and define seldom used data with  "progmem_far" attribute.

  Yes I understand what to have two similar sets of attributes and
functions is error prone, but it is necessary to allow to the programmer
to store more them 64KB data in program memory, not forcing it to write
the linker script.

 For 'xmega' devices it is necessary to add  '.apptable' section which
is located in the top 8(4)KB of FLASH.

What your opinion on this offer? 


reply via email to

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