Eeprom__rd_buffer_size buffer_length

Hello Everyone,
I’m trying to load a sketch that works fine on a nano, that writes an EEprom memory.
But I get this error:

C:\Users\focam\Documents\Arduino\libraries\Eeprom24C01_02-master\Eeprom24C01_02.cpp: In member function 'void Eeprom24C01_02::readBytes(byte, byte, byte*)':
C:\Users\focam\Documents\Arduino\libraries\Eeprom24C01_02-master\Eeprom24C01_02.cpp:52:35: error: 'BUFFER_LENGTH' was not declared in this scope
 #define EEPROM__RD_BUFFER_SIZE    BUFFER_LENGTH
                                   ^
C:\Users\focam\Documents\Arduino\libraries\Eeprom24C01_02-master\Eeprom24C01_02.cpp:219:33: note: in expansion of macro 'EEPROM__RD_BUFFER_SIZE'
     byte bufferCount = length / EEPROM__RD_BUFFER_SIZE;
                                 ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\focam\Documents\Arduino\libraries\Eeprom24C01_02-master\Eeprom24C01_02.cpp:52:35: note: suggested alternative: 'REG_DSU_LENGTH'
 #define EEPROM__RD_BUFFER_SIZE    BUFFER_LENGTH
                                   ^
C:\Users\focam\Documents\Arduino\libraries\Eeprom24C01_02-master\Eeprom24C01_02.cpp:219:33: note: in expansion of macro 'EEPROM__RD_BUFFER_SIZE'
     byte bufferCount = length / EEPROM__RD_BUFFER_SIZE;
                                 ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\focam\Documents\Arduino\libraries\Eeprom24C01_02-master\Eeprom24C01_02.cpp: In member function 'void Eeprom24C01_02::writePage(byte, byte, byte*)':
C:\Users\focam\Documents\Arduino\libraries\Eeprom24C01_02-master\Eeprom24C01_02.cpp:59:36: error: 'BUFFER_LENGTH' was not declared in this scope
 #define EEPROM__WR_BUFFER_SIZE    (BUFFER_LENGTH - 1)
                                    ^
C:\Users\focam\Documents\Arduino\libraries\Eeprom24C01_02-master\Eeprom24C01_02.cpp:255:33: note: in expansion of macro 'EEPROM__WR_BUFFER_SIZE'
     byte bufferCount = length / EEPROM__WR_BUFFER_SIZE;
                                 ^~~~~~~~~~~~~~~~~~~~~~
C:\Users\focam\Documents\Arduino\libraries\Eeprom24C01_02-master\Eeprom24C01_02.cpp:59:36: note: suggested alternative: 'REG_DSU_LENGTH'
 #define EEPROM__WR_BUFFER_SIZE    (BUFFER_LENGTH - 1)
                                    ^
C:\Users\focam\Documents\Arduino\libraries\Eeprom24C01_02-master\Eeprom24C01_02.cpp:255:33: note: in expansion of macro 'EEPROM__WR_BUFFER_SIZE'
     byte bufferCount = length / EEPROM__WR_BUFFER_SIZE;
                                 ^~~~~~~~~~~~~~~~~~~~~~
exit status 1
Errore durante la compilazione per la scheda Seeeduino XIAO.

Can anyone help me?

The error message is clearer and indicates that the BUFFER_LENGTH variable is not defined.

DO I have to declare it on Library or on code?

That library assumes that BUFFER_LENGTH has been #defined in Wire.h, which works for avr boards like the nano.
However…
The software tools developers for the Seeed XIAO boards did not define such a thing.

Next-to-bottom line: There is no way to define BUFFER_LENGTH in your sketch in a way that these library functions can compile.

You could try putting something like the following in the library file Eeprom24C01_02.h

 #define BUFFER_LENGTH 32

But, personally, I wouldn’t do this.

I would use Arduino’s Library Manager to install a more flexible library such as Rob Tillart’s excellent I2C_EEPROM library.

Bottom line: I have used this library for large and small I2C devices with a number of different CPUs (XIAO and oodles of other devices).

Regards,

Dave