8266 EEProm contents after code reprogramming

I plan to use EEProm of the 8266 and I have some questions about it in
advance.

Provided I was able to store data in the EEProm area, what happens if the
code will be updated by PlatformIO programmer? Is the EEPROM contents
still there after new start?

Is it possible to preset the EEProm area with certain data on demand?

Thanks

The ESP8266 does not have an EEPROM. This is only emulated. The data is stored in a specific area of the flash. When flashing a sketch, the memory area is retained.

See the examples

Thank you for this information. I intend to save WiFi settings in the
“EEProm” area. Would be not nice to reprogram everything again and again
during program test phase.

See the examples
[/quote]

That is not what I mean. I’m already able to write and read to “EEProm” area
Possibly I did not express my question good enough.
I would like to know if I can load default settings to the “EEProm” area during upload anyhow?

There is no need to store WiFi credentials in EEPROM because the
credentials are stored autimatically if a connection was successful.

The next time a call to WiFi.begin(); (without parameters) will use the stored credentials.

There is no way to “pre-program” the EEPROM except for doing this in your code.

Thank you again. That’s interesting, I didn’t know that. Nevertheless,
to be able to allow different user to setup different network settings via
UART connection, I plan to store them in “EEPROM”.

That makes my project a bit more complicated.

I appreciate you help, thanks again.

You can use a file system such as LittleFS to store configuration files on the ESP.
The file system can be flashed to the ESP separately from the firmware.
A good tutorial can be found here: