EEPROM volatility when unpacking the combined image

Hi all,

I was hoping to rely on the emulated EEPROM to store various static configuration for our application which uses the P0 hardware and the Spark firmware. These configurations must be permanently non volatile, which means that I can not risk to lose these values in any cases (well their is still a mechanism that I can use in case something goes wrong but it must not reach that for stability requirements).

I was looking around the firmware and notice that the function HAL_Core_Setup_finalize in the file hal/src/photon/core_hal.c uses the same flash area as the emulated EEPROM when unpacking the combined image and this is true only if the firmware is modular, which is the case by default with the Photon build. I search further in the firmware to find when this code should be executed but I am still without an answer.

I was wondering if any one here would know when the emulated EEPROM gets wiped out? Or maybe it never happens in some specific conditions?

Thanks in advance for your help!

@jberube, I believe the code you are seeing is designed for running as a virtual device (ie RPi) which does not have flash/eeprom so it must be emulated in a file and saved/loaded on each restart and firmware changes. For the Photon, the EEPROM area(s) remain untouched through resets and firmware changes. It is up to the user to initialize (clear) and validate the content of the “eeprom”. Perhaps @rickkas7 can validate this.

Oh I did not see it that way. I will continue to search along this path but that does make sense.

Thank you!

1 Like