-->
Page 1 of 1

Read/Write EEPROM directly

PostPosted: Thu Mar 23, 2017 12:22 pm
by sajado
Hi all,

Does anyone know of a way to directly read and write to and from the EEPROM of the ESP8266? By this I mean upload or download a hex (or somthing similar) to the EEPROM storage from a PC without touching the flash. I'm thinking something like an equivalent to
Code: Select all-U eeprom:w:somedata.hex

as used in avrdude.

I can't see anything in the ESP8266 DownloadTool that looks like it will do this, and I can't find anything on Google as it just brings up articles about manipulating EEPROM from within your software.

I am aware that I could have 2 pieces of software, one initial program that populates the EEPROM, then the actual software I want to run, but that's not quite the solution I'm looking for.

As for the rationale behind my request, I would like to bulk program a load of ESPs with software (or even get a supplier to do it) that looks for data (e.g. serial number) in the EEPROM. Then at a later time just upload a small file to the EEPROM with said data in, without having to reprogram the ESP entirely.

Any thoughts?

Re: Read/Write EEPROM directly

PostPosted: Thu Mar 23, 2017 12:40 pm
by martinayotte
EEPROM doesn't really exist in ESP8266, it is only an emulation done in Arduino-ESP framework, and this EEPROM bits are stored inside the Flash at location just after the SPIFFS location, before the WiFi configs.
https://github.com/esp8266/Arduino/blob ... OM.cpp#L44
You can directly access it with esptool.py at the following location with the sector size is 4096 :
EEPROM library uses one sector of flash located at 0x7b000 for storage.

Although this 0x7b000 could vary depending of the flash size and SPIFFS size.
http://esp8266.github.io/Arduino/versio ... ystem.html

Re: Read/Write EEPROM directly

PostPosted: Fri Mar 24, 2017 4:33 am
by sajado
Thanks! That's just the info I needed.