[Top][All Lists]

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

[avr-gcc-list] "progmem_far" attribute

From: Anatoly Sokolov
Subject: [avr-gcc-list] "progmem_far" attribute
Date: Fri, 2 May 2008 20:36:28 +0400


  Now GCC have "progmem" attribute to place data in the '.progmem' section.
The 'avr-libc' have set of '*_P' string functions for access to "progmem"
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 '.text'
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 library).

  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]