trouble reading 16u2 with DueEeprom library

Hi All,
First i'd like to say thanks to all of you for all the help its given me over the last few months. Every issue that Iv'e come across has been covered in various threads, up until this one.
I've made a project to control my pond on the Mega and it works well but i'd like to do more work with the touch screen as the layout is quite basic, the mega is getting quite slow with what im asking it to do with the screen. I decided to try the Due. I Have changed the reset lines over and have put in a button cell to keep the rtc alive.
I found this thread that seamed to solve the no eeprom issue https://forum.arduino.cc/index.php?topic=191298.0 but it wouldnt compile, i've played with the variant files (attached). It now compiles and i can now read and write as per the examples but if i try to read one address and assign it, it freezes and wont read the next eeprom address until i open the serial monitor, it will reset and read them all. In the main program i use about 40 eeprom addresses. I cant use the due like this in case i have a power outage. I know that i can use i2c eeprom and rtc but i'm trying to keep the chip count down
I've stripped the code right back to the bare minimum, in an attempt to find my mistake,

#include <DueEeprom.h>
#include <UTFT.h>


UTFT myGLCD (SSD1963_800, 25, 26, 27, 28); // 5" screen

const byte mainPumpStateMemory = 100;
const byte mainPumpButtonMemory = 101;
const byte uvc = 102;

byte mainPumpState; 
byte mainPumpButton; 
extern uint8_t BigFont[];


void setup() {
  DueEeprom.begin();           // default pin 93
  myGLCD.InitLCD(LANDSCAPE);
  myGLCD.clrScr();
  myGLCD.setColor(VGA_WHITE);
  myGLCD.setFont(BigFont);

  myGLCD.drawRoundRect (22, 15, 777, 79);       //frame for time/date
  mainPumpState = DueEeprom.read(mainPumpStateMemory);
  myGLCD.printNumI(mainPumpState, 59, 100);
  myGLCD.drawRoundRect (500, 95, 777, 460);
  
  myGLCD.printNumI(DueEeprom.read(uvc),200,200);
  
  myGLCD.printNumI(digitalRead(92), 100, 200);
  mainPumpButton = DueEeprom.read(mainPumpButtonMemory);
  myGLCD.printNumI(digitalRead(92), 150, 200);
  myGLCD.drawRoundRect (22, 300, 485, 460);     //frame for cycle/water usage details
  myGLCD.printNumI(mainPumpButton, 200, 100);
}

void loop() {
  // put your main code here, to run repeatedly:

}

The boxes and text are just to see where it was freezing because if i run serial monitor the problem doesnt exist.
I have started to wonder if the problem is within the 16u2 but i havent found any reported problems online.

Thanks in advance.

Regards Mark

variant.cpp (23.6 KB)

variant.h (8.68 KB)

Try with DUE Flash Storage library: