Page 1 of 1

clearing exp32 rtc memory

Posted: Tue Mar 01, 2022 11:27 pm
by k1teBRADSHAW
I would like to use esptool.py to clear the 8kb of rtc memory, prior to loading my Platformio build.

I find a boot count on the first start up of the code. I would like to start at zero, or one.

Is this a good idea? Is this worth the effort?

Thanks, Bradshaw

Re: clearing exp32 rtc memory

Posted: Wed Mar 02, 2022 2:03 am
by ESP_Sprite
The RTC memory loses power when the EN line (the reset line) of the ESP32 is low, which happens after flashing; whatever value esptool puts there will go away anyway. Better to detect that the bootup count value is invalid (e.g. by storing the value and its inverse in the two halves of a 32-bit RTC variable so you can write them atomically, and comparing if the value is still the same as its inverse)

Re: clearing exp32 rtc memory

Posted: Sun Jun 19, 2022 6:23 pm
by k1teBRADSHAW
Thank you! Clear, reliably simple!