Photon write eeprom(flash) on flashing

Hi guys,

Any idea how can I write(save) the eeprom part on the photon flash memory so it will contain some data on first run after uploading the firmware?

Thanks!

The Docs are probably the best place to start

https://docs.particle.io/reference/firmware/photon/#eeprom

You might need to add a part to your program that (re)establishes default settings for several reasons not only for first run.

I guess you could also flash the respective area via dfu-util, but I wouldn’t call this good practice.

You should have a validity check in your code in case anything goes wrong while writing or due to other reasons and then revert to proven good defaults.