Memory space that remains unaffected on reset on ESP32
Is there any way to store some variables which doesn't get affected on Reset?
I saw this memory partition named as NVS in Arduino ESP32 and ESP-IDF. This might work for me but I guess it hasn't been implemented on Micropython yet.
Any other way to store variables that remain unchanged on reset?
I want to store password credentials after acquiring once into memory space that is unaffected by reset.
esp32/machine_rtc: Preserve RTC user memory over most reset causes.
ESP32: New compile-time #define allowing to preserve the RTC slow memory during most resets.
Usage:
#define MICROPY_HW_RTC_USER_MEM_NOINIT
e.g. in port/esp32/board/XXX/mpconfigboard.h
When above is defined, the user memory area - accessible by machine.RTC.memory() will survive most reboot causes. A power-on reset (also caused by the EN pin on some boards) will clean the memory. When this happens, the magic number not found in the user memory will cause initialization.
After other resets (triggered by watchdogs, machine.reset(), ...), the user is responsible to check and validate the contents of the user area.