- I expected the data will be allocated separately automatically into EEPROM_FC,EEPROM_FD,EEPROM_FE by compiler.
No, you expected to much. Allocated object can't be larger than segment you try to allocate your data to. So for EEPROM pages you are limited to 1k, for GPAGE pages you are limited to 64k. So for your large struct you have two options, either split big object into smaller ones using SW, or use GPAGE addressing.
For GPAGE addressing you need to combine your EEPROM segments into single because object still can't be larger than segment. So instead of this
SEGMENTS
EEPROM_FC = READ_ONLY DATA_FAR IBCC_FAR 0xFC0800 TO 0xFC0BFF;
EEPROM_FD = READ_ONLY DATA_FAR IBCC_FAR 0xFD0800 TO 0xFD0BFF;
EEPROM_FE = READ_ONLY DATA_FAR IBCC_FAR 0xFE0800 TO 0xFE0BFF;
END
you need this
//EEPROM_FC = READ_ONLY DATA_FAR IBCC_FAR 0xFC0800 TO 0xFC0BFF;
//EEPROM_FD = READ_ONLY DATA_FAR IBCC_FAR 0xFD0800 TO 0xFD0BFF;
//EEPROM_FE = READ_ONLY DATA_FAR IBCC_FAR 0xFE0800 TO 0xFE0BFF;
// gpage address is 0x140000 - (0x100-EEpageno)*0x400
// FC-> 0x13F000
// FD 0x13F400
// FE 0x13F800
EEPROM_FCFE = READ_ONLY 0x13F000'G TO 0x13FBFF'G;
'G is global address notation in PWM.
Then change your placement to
PLACEMENT
EVENT_LOG INTO EEPROM_FCFE ;
END
Now you should tell compiler you will use global addressing to access your large object:
#pragma DATA_SEG __GPAGE_SEG EVENT_LOG
static U16 Checksum_Fault_Log;
static EVENT_LOG_DATA_TYPE Event_Log;
char bigdata[2*0x400 + 5]; // more than 2 EE pages
#pragma DATA_SEG DEFAULT
if bigdata is shared, please round declaration in header file with the same pragmas
Edward