I think I have resolved this problem. I should only call DEFlashPartition() once when not configured. If I do this then I can write to the EEPROM area OK.
I check if the FlexNVM is already partitioned by looking at the EESize in the flashpartition structure.
if ( flash1_InitConfig0.EEESize != 0x80 )
{
// DEFlashPartition should only be called once when FlexNVM is not setup.
// So after first factory boot up this function should never be called again.
result = DEFlashPartition ( &flash1_InitConfig0, 0x37, 0x03, g_FlashLaunchCommand ) ;
}
// Test write and read to EEPROM
eepromData = 0x12345678 ;
result = EEEWrite ( &flash1_InitConfig0, 0x14000000, 4, (uint8_t*) &eepromData ) ;
eepromData = * ((unsigned int*) 0x14000000) ;
So I think my FlexNVM is working OK. I can also write to the DFlash Space which is not allocated to EEPROM emulation.
Thanks Alice for helping me with this.
regards
Sean