← index #4856PR #6785
Related · high · value 1.277
QUERY · ISSUE

Memory space that remains unaffected on reset on ESP32

openby hetvishah08opened 2019-06-18updated 2020-08-02
port-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.

CANDIDATE · PULL REQUEST

esp32: control the python heap size via NVS variables

closedby tveopened 2021-01-18updated 2022-11-21
port-esp32

This PR builds on top of #6780 and #6782.

This commit allows the user to limit the micropython heap size by setting NVS variables. This supports:

  • ensuring that esp-idf has enough memory for multiple TLS connections, TLS plus BLE, etc.
  • leaving some SPIRAM memory for native modules, such as camera framebuffers
  • reducing the SPIRAM memory to limit GC sweep times

See the docs changes for more rationale and details.
A test script is included, but not usable with run-tests due to the resets required.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied