RTC Data reset/lost after sleep
Posted: Fri Sep 06, 2019 4:34 pm
I'm probably out of my depth in this forum but I will ask anyway.
I have an ESP32 WROOM board. I'm programming it with the arduino IDE.
I save a variable using
Increment loop and set the sleep timer :
The program should cycle sleep 12 times and then reset the loop variable.
Occasionally it will make it through all 12 cycles no problem but, more often than not, the loop variable will be reset to 0 after coming out of sleep before 12. There is no pattern to the failures, it can happen during any iteration.
Any suggestions would be appreciated. Sorry if this is problem is not appropriate for this form.
Cheers.
I have an ESP32 WROOM board. I'm programming it with the arduino IDE.
I save a variable using
Code: Select all
RTC_DATA_ATTR int loop = 0
Code: Select all
loop ++;
esp_sleep_enable_timer_wakeup(sleeptime * uS_TO_S_FACTOR);
esp_deep_sleep_start();
Occasionally it will make it through all 12 cycles no problem but, more often than not, the loop variable will be reset to 0 after coming out of sleep before 12. There is no pattern to the failures, it can happen during any iteration.
Any suggestions would be appreciated. Sorry if this is problem is not appropriate for this form.
Cheers.