Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eeprom_read returns all 0 if data length > 128 #3

Closed
alw1746 opened this issue Apr 6, 2020 · 5 comments
Closed

eeprom_read returns all 0 if data length > 128 #3

alw1746 opened this issue Apr 6, 2020 · 5 comments

Comments

@alw1746
Copy link

alw1746 commented Apr 6, 2020

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
Copy link
Owner

Naguissa commented Apr 7, 2020

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
Copy link
Author

alw1746 commented Apr 7, 2020

Ok thanks. will close this issue now.

@alw1746 alw1746 closed this as completed Apr 7, 2020
@Naguissa
Copy link
Owner

Naguissa commented Apr 8, 2020

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 Naguissa reopened this Apr 8, 2020
@Naguissa
Copy link
Owner

Naguissa commented Apr 9, 2020

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 added a commit that referenced this issue Apr 21, 2020
 - Implement paged reads and writes (32 bytes pages, as 64 bits doesn't fit on Wire library's buffer) to mitigate EEPROM wearing.
 - Added html documentation
 - Splitted docs and extras to another repository
@Naguissa
Copy link
Owner

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants