Naguissa / uEEPROMLib

I2C EEPROM library. Split from uRTCLib. This library controls any I2C EEPROM, independent ones or incorporated on DS1307 or DS3231 RTCs.
https://www.foroelectro.net/librerias-arduino-ide-f29/ueepromlib-arduino-libreria-simple-y-eficaz-para-e-t225.html
GNU Lesser General Public License v3.0
17 stars 4 forks source link

eeprom_read returns all 0 if data length > 128 #3

Closed alw1746 closed 4 years ago

alw1746 commented 4 years ago

Arduino IDE 1.8.8, NodeMCU-32S, Windows 10, DS3231 RTC, uEEPROMLib 1.0.1

Attached test sketch. Sketch writes a counter value to EEPROM at START_ADDR for DATA_LENGTH. If DATA_LENGTH = 128, results 0 - 7F displayed. But if DATA_LENGTH = 129, 0 are returned.

Given the number of bytes to read is uint8_t in the library, it should allow read up to 256 bytes. Is 128 bytes a limitation? EEPROM_test.ino.txt

Naguissa commented 4 years ago

Hello,

I've seen there're problems when reading big chunks in one go.

A common fix is to split any read in 32 bytes max reads. I'll integrate it and do a new release.

Cheers!

alw1746 commented 4 years ago

Ok thanks. will close this issue now.

Naguissa commented 4 years ago

No, no; I'm implementig internally on the library, so I'll change it when done.

I've done only a change that may affect compatibility: now on read funtion length will be a unint16_t instead a uint8_t. This will grant requesting more than 256 bytes in one call...

Cheers!

Naguissa commented 4 years ago

It's taking a while because I'm implementing page read/write and improving speed, I need to test changes deeply on several boards...

Naguissa commented 4 years ago

Fixed on new release 1.1.0.

Also I've implemented paged reads and writes in 32-bytes pages (half of RTC's EPPROM page size, but Arduino Wire buffer is 2 bytes less than necessary to handle 64 bytes pages).

Cheers!