Page 1 of 1

(Solved) Totally not 'esp_wifi_disconnect wipes ULP RTC memory on deepsleep?'

Posted: Mon Dec 14, 2020 9:42 am
by istokm
Is it possible that calling esp_wifi_disconnect somehow affects the ULP and/or the data in RTC memory that is shared with the main cpu? RTC memory resetting to 0 would very nicely explain some strange behaviour I'm seeing right now, and I want to check that this is not a known thing. As this theoretical wipe happens on power down, It's extremely difficult for me to debug this (just calling esp_wifi_disconnect doesn't wipe anything, but going into deepsleep after it does - and the issues go away If I remove the wifi disconnect call).

Re: esp_wifi_disconnect wipes ULP RTC memory on deepsleep?

Posted: Mon Dec 14, 2020 4:29 pm
by istokm
I was making a follow-up to this post, describing log output, commit number, etc.. and then it hit me. This is totally not a thing, just a nasty chain of event handlers that got fired in my own code - leading to esp_restart -> which in turn caused the ulp to get reinitialized due to the wakeup reason, and thus, wiped all RTC data to 0. This was probably the nastiest thing I had to debug yet.

Thanks for coming to my Ted talk.