writing eeprom structure on ESP8266

Hi

have a question.

Want to write an EEPROM with structure.

How to set size of

EEPROM.begin()

?

can it only be a fix size or can

sizeof(structure)+1

be used?

Thanks

riker1:
Hi

have a question.

Want to write an EEPROM with structure.

How to set size of

EEPROM.begin()

?

can it only be a fix size or can

sizeof(structure)+1

be used?

Thanks

it can be the size of the structure

Hi
thanks

what happens if the size is changing while content of structure is changing?

epprom.begin(size)

has so be set for esp8266 I think.

I experienced that after writing the structure to eeprom.
I can not reboot and I have to flush it new.

Maybe any known problem?

Thanks T

Hi

looks like the restart problem is caused by an ESP problem.

You have to manually reboot it once after is it flashed.

otherwise ESP will not restart and esp.restart() ist not working and eeprom.write() as well....

just a hint.

not totally confirmed yet

riker1: Hi

looks like the restart problem is caused by an ESP problem.

You have to manually reboot it once after is it flashed.

otherwise ESP will not restart and esp.restart() ist not working and eeprom.write() as well....

just a hint.

not totally confirmed yet

after flashing, esp.restart() (soft-reset) returns to flashing mode. it is a bug of the esp8266. the esptool used in 2.5.0+ versions of the esp8266 arduino core invokes a hard reset after flashing to avoid this problem.

do you use EEPROM.end() or EEPROM.commit()?

Hi

I use eeprom.commit()

The idea of this EEPROM system is to limit the writes to the EEPROM, since it is using flash it would be a waste to use it for every single byte written.

understood, just using it for storing persistant configuration...so not often and only on demand