mirror of
https://github.com/espressif/esp-idf.git
synced 2026-07-15 23:43:02 +03:00
On ESP32-S2/S3 the ULP-RISC-V ADC shares the RTC SAR controller with the main CPU. ulp_adc_init() sets sar1_en_pad_force = 1 so software selects the channel, but deep-sleep entry resets it to 0 (ULP/HW control). After that, the per-read channel selection in ulp_riscv_adc_read_channel() is ignored and every channel returns the same stale value. Single-channel worked only because the channel never changed. Re-assert RTC controller (sar1_en_pad_force = 1) before selecting the channel on each read so multi-channel sampling works after deep sleep.