Hi
In answer to your first question if you want to create an EEPROM in memory you need to edit your icf file with something like this below.
Note the placement section because if you don’t place at the end then as your program grows your EEPROM will move and you will lose your EEPROM data
The EPPROM has 8 sectors 0 to 7 and for some reason you cannot write to sector 0 normally this is where the device information is stored on a “real chip”
define exported symbol __FLASHX_SECT_SIZE = 0x800;
define block FLASHX_POOL with alignment = __FLASHX_SECT_SIZE { section .flashx };
// Initialise
do not initialize { section .flashx };
keep { section .flashx };
// Placement
place at address mem:__ICFEDIT_region_ROM_end__ - 0x04800 { block FLASHX_POOL };
I hope this is off some use