-->
Page 1 of 1

RTC: Unable to save data through reset

PostPosted: Wed May 03, 2017 11:17 am
by Kim Volz
Hello, I found a video to help get the RTC memory to hold information. However, it does not seem to work when I use Deep Sleep and reset the processor. Basic Flow
setup()
system_rtc_mem_read // SHOULD get the data from the RTC but only gets zeros

loop()
// do some work
// update rtc structure
system_rtc_mem_write // save for when we wake up
ESP.deepSleep(15000, WAKE_RFCAL);

The deepSleep and the RTC work independently. Anyone doing this typical IoT stuff?
Any help or working example code would be greatly Appreciated!!!

Kim

Re: RTC: Unable to save data through reset

PostPosted: Fri May 05, 2017 2:53 pm
by Kim Volz
Hello,

I found the fix! You can read as much or as little and have Random Access. However, you MUST write the entire memory space otherwise the data is NOT retained over resets. Obviously, none of the data is maintained over power interruptions (off then back on).

Kim