Noggin - another update. After reading the AN1095 DEE Emulation DS01095D dated 2011 page-14 I changed a couple of the relevant defines:
// User defined constants
//=======================
// total number of 32-bit data
#define DATA_EE_SIZE (32) // was (680)
// total number of pages reserved
// for the operation
#define NUM_DATA_EE_PAGES (2) // was (3)
// Internal constants
//===================
// maximum erase cycle per page
#define ERASE_WRITE_CYCLE_MAX (1000)
// number of 32-bit word instructions per page
#define NUMBER_OF_INSTRUCTIONS_IN_PAGE (512) // was (1024)
// the point where address starts
#define DATA_OFFSET (1000) // was (1360)
// total page size in bytes
#define PIC32MX_PAGE_SIZE (NUMBER_OF_INSTRUCTIONS_IN_PAGE*4)
and now I don't get any "page corrupt" or "write error" flags getting set but my test "write" then "read" still does not work
Even if I get MPLAB to display the memory it still does not show the 0x00007575 that I wrote.
// call initialization function before any DEE related functions
DataEEInit();
DEEaddr = 0x00;
DEEdata = 0x7575;
// unsigned int DataEEWrite(unsigned int data, unsigned int addr);
value = DataEEWrite(DEEdata,DEEaddr);
DEEdata = 0x00; // clear the variable to test that the READ routine actually works !
// unsigned int DataEERead(unsigned int *data, unsigned int addr);
DEEdata = DataEERead(&value, 0x00);