> EEPROM = READ_ONLY 0xF000 TO 0xFFFF;
The linker uses paged addresses, and 0xF000 TO 0xFFFF are paged flash addresses, not EEPROM.
Using EEPROM should not require any special access macros if the prm file is properly setup.
Note that the F000..0xFFFF normally has to be used for FLASH (as it is intended) as this area contains the vectors. So it really is not available for anything else.
So either use paged EEPROM addresses (recommended) as it is done in all the default prm files:
Code:
/* non-paged EEPROM */ EEPROM = READ_ONLY 0x0C00 TO 0x0FFF;/* paged EEPROM 0x0800 TO 0x0BFF; addressed through EPAGE */.... EEPROM_1F = READ_ONLY 0x1F0800 TO 0x1F0BFF; EEPROM_FE = READ_ONLY 0xFE0800 TO 0xFE0BFF;/* EEPROM_FF = READ_ONLY 0xFF0800 TO 0xFF0BFF; intentionally not defined: equivalent to EEPROM */
or use global addresses (only recommended if large >1k objects are in EEPROM)
> EEPROM_FE = READ_ONLY 0x13F800'G TO 0x13FBFF'G;
Note that even when using global addresses, you have to split up the EEPROM into 1k pages if you are accessing its content via EEPAGE mechanism (or unpaged), otherwise the linker will place objects across page boundaries so it will fail at runtime.
The only time I would suggest to use global addresses is with a few large (>=1k) objects, then those wont be accessible via single EEPAGE (__eptr pointers) anyway and would have to be accessed using the GPAGE register.
When placing variables into EEPROM above, using 16 bit __near pointers should work fine. When placing variables into any other EEPROM page segment, using __eptr (__EPAGE_SEG section qualifier) is most efficient, using __far (__GPAGE_SEG section qualifier) works too.
Daniel