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.