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
clearing exp32 rtc memory
-
- Posts: 2
- Joined: Tue Mar 01, 2022 11:16 pm
-
- Posts: 9770
- Joined: Thu Nov 26, 2015 4:08 am
Re: clearing exp32 rtc memory
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)
-
- Posts: 2
- Joined: Tue Mar 01, 2022 11:16 pm
Re: clearing exp32 rtc memory
Thank you! Clear, reliably simple!
Who is online
Users browsing this forum: No registered users and 55 guests