I have been deveoping an Arduino projecct with some image data in PROGMEM that pushes the total PROGMEM usage above 64K. The problem is that once this boundary is exceeded several core functions that use PROGMEM structures start playing up. In particular the portInputRegister macros don't work and all the I/O fails!
Arduino.h extract:
#define portInputRegister(P) ( (volatile uint8_t *)( pgm_read_word( port_to_input_PGM + (P))) )
The pgm_read_byte_far() macro (refered to in other posts and forums) is not really practical in this situation as all PROGMEM access would have to change. A better solution is to leave the core data in the low 64K and have another segment in a higher area of memory.
After much experimentation I found that the following will push the data into the highest area of the .text segment above the code:
const uint16_t First_Quarter[0xD24] attribute((section(".fini7"))) ={ .....
rather than the following that leaves it in the lower 64K:
const prog_uint16_t First_Quarter[0xD24] ={ ....
or
const uint16_t First_Quarter[0xD24] PROGMEM ={ ....
Then you can selectively access data with the pgm_get_far_address macros for the data in the upper memory area:
uint_farptr_t MoonPic = pgm_get_far_address(First_Quarter);
Q. Is attribute((section(".fini7"))) a valid method for this workaround or is there a better solution?