logo elektroda
logo elektroda
X
logo elektroda

Saving sensitive data before soft reset with OTA update for ESP32/ESP8266

Slawek K. 987 4
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 20262329
    Slawek K.
    Level 35  
    Posts: 3015
    Help: 259
    Rate: 1299
    Hi,

    I need to save in flash or eeprom some sensitive data necessary for the operation of the device after resuming operation after a reset. Unfortunately, the frequency of changing the values of the variables during operation does not allow me to use flash or eeprom on the fly because they would run out very quickly due to the limit of writes.
    Is it possible to monitor some kind of flag that would allow to dump data before soft reset ? this only applies to the situation when restarting after a firmware update via OTA, it does not apply to power off as the chip is powered from batteries.

    Best regards
  • ADVERTISEMENT
  • #2 20262388
    funak
    Level 27  
    Posts: 1077
    Help: 101
    Rate: 460
    Use FRAM, or just SRAM if you have the chip powered all the time.

    Added after 2 [minutes]: .

    Example of FRAM: 512B (512x8) I2C memory
    https://www.mouser.pl/ProductDetail/Fujitsu-S...-G-JNERE1?qs=HBWAp0VN4RjODl%252BGKL9JWw%3D%3D

    Added after 1 [minute]:

    And here you have the CFI:
    https://www.mouser.pl/ProductDetail/Infineon-...es/FM25L04B-G?qs=pA5MXup5wxElRCah1DKWAQ%3D%3D
  • ADVERTISEMENT
  • #3 20262443
    Slawek K.
    Level 35  
    Posts: 3015
    Help: 259
    Rate: 1299
    Thanks for the idea. I don't want to extend the controller with more circuits. I want to use the capabilities of esp32 (if it has them) to detect the state before soft reset and save the data, the data is not much because it is just 3 variables of 4 bytes.

    Greetings
  • ADVERTISEMENT
  • Helpful post
    #4 20262487
    Anonymous
    Level 1  
  • #5 20266576
    Slawek K.
    Level 35  
    Posts: 3015
    Help: 259
    Rate: 1299
    @khoam , thanks :) .

    Greetings
ADVERTISEMENT