Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By Alan-bc
#86947 I've wired up an ESP8266 (WeMos Mini) and have been making use of the module's "built in" EEPROM, programming it as if it were an Arduino.

The docs are unclear on how this magic works, as there isn't an actual EEPROM chip anywhere, but it works. Write to EEPROM, remove power, data is retained.


Later, I added an DS3231 RTC with an actual 24C32 EEPROM (the cheap module found everywhere).


My question is, when I use EEPROM.read (or .write or .get or .put), which EEPROM am I using?


I'd LIKE to use both, as there's two versions of the project, one with RTC and one without. Both versions of the project store ESP8266 initialization data, but only the version with the RTC module stores RTC data.

Is this possible? Can I use both? Any clues gratefully accepted.


Thanks in advance.

Alan
User avatar
By eriksl
#86971 There is a recent topic about this. The ESP8266 does not have EEPROM. It uses FLASH memory to store both program and non-volatile data. For Arduino, which does have the concept of "EEPROM", it can emulate it though by using FLASH. So, no, there is no EEPROM.
User avatar
By btidey
#86977 I know this is pedantic but Flash is actually just one (very common) form of EEPROM. This was also discussed recently.

Arduino uses the term EEPROM to refer, somewhat misleadingly, to a specific area of non-volatile memory using a non-flash type of EEPROM which allows easy access to persistent storage of small amounts of data.

It is correct that ESP8266 Arduino emulates this "EEPROM" area by emulating it by using the normal Flash EEPROM also used for program code and other data uses like SPIFFS. Because Flash is only programmable by erasing blocks prior to writing then additional care has to be taken to avoid wearing out the cells too rapidly.