← index #5651PR #5380
Related · high · value 1.887
QUERY · ISSUE

ESP32: deep sleep seems to cut clock to ULP processor

openby flo-rianopened 2020-02-16updated 2025-09-23
port-esp32

It seems like going to deep sleep stops the ULP processor. I uploaded a counter code to the ULP and it counts nicely as long as main CPUs running. When going to deep sleep counting stops but the counter value remains so the ULP was not reset or memory erased. After coming back from deep sleep counting works again.

As a side note: I would like to suggest to also add the ULP as a wakeup source in the esp32 package (in addition to the EXT, timer and touch options).

CANDIDATE · PULL REQUEST

esp32/ulp: Explicitly enable ULP in build config.

closedby andrewleechopened 2019-12-04updated 2019-12-05
port-esp32

Resolves esp32: ULP binary loading support was broken after 1.10 release #5159

I was able to reproduce the working ULP example in v1.10 using https://github.com/ThomasWaldmann/py-esp32-ulp/blob/master/examples/counter.py

As described in https://github.com/ThomasWaldmann/py-esp32-ulp/issues/42 this was broken in v1.11 release, throwing an OSError: 260
I was also able to reproduce this error.

The same error is present on current master builds for both IDF v3 and v4

Explicitly enabling ULP in the board config as attached fixes the error, allowing the counter example to run the same as v1.10

I'm not sure if CONFIG_ESP32_ULP_COPROC_RESERVE_MEM=1024 is the most appropriate value, this was picked from https://github.com/espressif/esp-idf/blob/master/examples/system/ulp/sdkconfig.defaults

This example config has only 512 however:
https://github.com/espressif/esp-idf/blob/master/examples/system/deep_sleep/sdkconfig.defaults

The ULP ram is taken out of RTC slow ram, I'm not sure what else uses this?
https://docs.espressif.com/projects/esp-idf/en/latest/api-reference/kconfig.html

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