Programming EEPROM IC not working as expected

I’m trying to write a bunch of data (around 80 KB) to a 24LC1025 EEPROM. I’m using a python script to send the data to an Arduino UNO, which writes the data to the EEPROM in 30 byte cycles using the Wire library (it’s using a 32 byte buffer, but wasn’t sure if this includes the address bytes). The code I wrote works for the first 4 cycles (4 x 30 bytes), but after the 5th, the whole written data is shifted in the memory (trying to read data from the address 0 reads data which should be at 128). The python script is working correctly, I think the problem is with the C code.

#include "Wire.h"

#define _VERIFY  251
#define _FINAL   250

#define BLOCK0_ADDRESS 0b01010011
#define BLOCK1_ADDRESS 0b01010111

uint8_t in;

uint8_t sublist[30];
uint16_t address;

char writeEEPROM(uint8_t block, uint8_t len){
  Wire.beginTransmission(block);
  
  Wire.write((uint8_t) address >> 8);   //High byte
  Wire.write((uint8_t) address & 0xFF); //Low byte
  
  for(int b=0;b<len;b++){
    Wire.write(sublist[b]);
  }

  return Wire.endTransmission();
}

void writePrimeGaps(){
  address = 0;
  uint8_t resp;

  for(int i=0;i<5;i++){
    Serial.readBytes(sublist,30);
    resp = writeEEPROM(BLOCK0_ADDRESS,30);
    Serial.write(resp);
    address += 30;
  }
}

void verifyData(){
  uint8_t A[2];
  Serial.readBytes(A,2);  //Read address bytes
  
  Wire.beginTransmission(BLOCK0_ADDRESS);
  Wire.write(A[0]);   //High byte
  Wire.write(A[1]);   //Low byte
  Wire.endTransmission();
  Wire.requestFrom(BLOCK0_ADDRESS,1);

  uint8_t dat = 0xFF;
  if(Wire.available()){
    dat = Wire.read();
  }

  Serial.write(dat);
}

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(115200);
  Serial.setTimeout(10000);
  Wire.begin();
  Wire.setClock(100000);
}

void loop() {
  if(Serial.available() > 0){
    in = Serial.read();
    if(in == _VERIFY){
      verifyData();
    }else if(in == _FINAL){
      writePrimeGaps();
    }
  }
  
  digitalWrite(LED_BUILTIN, HIGH);
  delay(1000);
  digitalWrite(LED_BUILTIN, LOW);
  delay(1000); 
}

What am I missing?

What am I missing?

You are performing block writes of 30 bytes, and are running into eeprom page boundary issues. Page size in that eeprom is 128 bytes and data will wrap if you try to write a block across the page boundary.

I think your easiest work around is to try writing in 16 byte blocks.