I'm aware of RTC_DATA_ATTR, but the components/esp32/cpu_start.c does this:
Code: Select all
/* Unless waking from deep sleep (implying RTC memory is intact), clear RTC bss */
if (rst_reas[0] != DEEPSLEEP_RESET) {
memset(&_rtc_bss_start, 0, (&_rtc_bss_end - &_rtc_bss_start) * sizeof(_rtc_bss_start));
Flash/NVS would work except for (a) write count limitations, and (b) it doesn't meet the requirement of zeroing the value on a power cycle.
Anybody have any ideas for where I can store stuff that would behave like that? I only need a few bytes. It seems to be that storing it in RTC RAM, but outside the rtc_bss segment, might work?