Just a newby asking the 64k question again - Arduino Mega2560

Hi Nick
Yes, I have seen in the code <pgmspace.h> and also <morepgmspace.h> where for machines that support ELPM, the macros pgm_read_xxx_far are mapped into ELPM calls instead of LPM.
However, I've yet to determine exactly how to use those. It does seem to work just fine when I have a single 64k block of flash data tagged with the attribute PROGMEM. I think this is true because the following works:

#include <pgmspace.h>
//...(other includes)
char myString[10];
const char abc[] PROGMEM = "abc";
const char def[] PROGMEM = "def";
const char* abcdef[] PROGMEM = {abc,def};
// ... stuff
for(int i=0;i<2;i++){
strcpy_P(myString,pgm_read_word(&abcdef[i]));
Serial.println(myString);
}

Note the use of strcpy_P is defined in <pgmspace.h>. Note also that I can address the array with a var, which does not seem to be true if you try to create a var in memory space mapped through other means - like the terms PROGMEM_FAR and PROGMEM_SEGx as specified in <morepgmspace.h> In those cases, the compiler seems to want a static situation where you do something like;

long_address = GET_FAR_ADDRESS(abcdef) + BASE_ADDRESS_OF_MEMORY_SECTION + (which element)*sizeof(int);
strcpy_whatever(myString, pgm_read_word(long_address);

I suppose 24-bit addressing must exist (at least, 18-bit addressing must) exist even to accept an address in that upper 256k...

If I use multiple 64k flash sections or I just try to rely on 24-bit addressing by specifying

#include <morepgmspace.h>
const variable myVar[70k's worth]... a whole lot of stuff more than 64k

then this does not work...

int abc = pgm_read_word(&abcdef[i]);

So I am unsure of the occasions when 24-addressing is supported by the current compiler/linker, and when it's not... As I said, it seems that with versions avr-gcc 4.6.2 and 4.7.2 it does not balk at the code which calls more than 64k. But I haven't yet figured out if I can actually make it work with my app. I still have to go back and de-Arduino-ize my Arduino code into pure AVR code to try that in another environment, like AVR-Eclipse or AVR-XCode, which support those compiler versions...

Cheers
Joe