clearing exp32 rtc memory

k1teBRADSHAW
Posts: 2
Joined: Tue Mar 01, 2022 11:16 pm

clearing exp32 rtc memory

Postby k1teBRADSHAW » Tue Mar 01, 2022 11:27 pm

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
K1te@piRshared.org
Buzzards Bay, MA, USA
STEM hw/sw 2014-

ESP_Sprite
Posts: 9770
Joined: Thu Nov 26, 2015 4:08 am

Re: clearing exp32 rtc memory

Postby ESP_Sprite » Wed Mar 02, 2022 2:03 am

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)

k1teBRADSHAW
Posts: 2
Joined: Tue Mar 01, 2022 11:16 pm

Re: clearing exp32 rtc memory

Postby k1teBRADSHAW » Sun Jun 19, 2022 6:23 pm

Thank you! Clear, reliably simple!
K1te@piRshared.org
Buzzards Bay, MA, USA
STEM hw/sw 2014-

Who is online

Users browsing this forum: No registered users and 80 guests