Page 8 of 8

Re: EEPROM put and get methods

PostPosted: Thu Apr 20, 2023 5:51 am
by beic
frankygoop wrote:Hello, I have tried several codes with all possible options with EEPROM " put" and " get" and work fine with Address 0, but wont work with any different address.
I am on board ESP8266 3.1.1,
I tried several older board version down to 2.5.0 and IDE version 1.8.16. nothing works.
Any advise is welcome.
Thank you

I found that in order to write into another address, the EEPROM.begin(XXX) need to include the total amount of necessary memory covering all possible addresses starting from 0 that you expect to write. I mean you can not do two separate EEPROM.begin. Is that the normal behavior?

Did you found any solution? I have the same issue in Arduino IDE v1.8.2 and ESP8266 Core v2.3.0

Re: EEPROM put and get methods

PostPosted: Fri Jun 02, 2023 1:34 pm
by wogoos
Hi frankygoop,
I have been looking at the .h and .cpp libraries and can see that according the comments at line 58 "//In case begin() is called a 2nd+ time, don't reallocate if size is the same" you can do a second .begin() call. However, the sizes must be the same in both calls.
The problem I have with that commend is that according to the code in the .cpp file I see that two different memory buffers are created and that is not inline with the commend I read.
Two memory buffers and a commit that writes to one flash sector doesn't sound logic since which of the who buffer is written to flash meaning which one is it? So my conclusion is yes you can do two .Begin() call having two separate memory buffers, but you can't commit both.