I'm making a program for the ESP32-S2 on ESP-IDF that takes a measurement, reports it and goes to sleep, the datasheet says the module should consume around 25 uA when using RTC_Memory an I get that when I just write a code that puts the module to sleep, but when a flash the program for my application it consumes 200 uA, before it was over 1mA but noticed the ADC module was still on, after turning it off it came down to the mentioned 200uA, can you guys help me figure out what else might be still on while on deep sleep?
I can't share the whole code but here is the configuration part.
Code: Select all
gpio_config_t io_conf;
io_conf.intr_type = GPIO_PIN_INTR_DISABLE;
io_conf.pull_down_en = 0;
io_conf.pull_up_en = 0;
io_conf.mode = GPIO_MODE_INPUT;
io_conf.pin_bit_mask = INPUT_LIST;
gpio_config(&io_conf);
io_conf.mode = GPIO_MODE_OUTPUT;
io_conf.pin_bit_mask = OUTPUT_LIST;
gpio_config(&io_conf);
esp_adc_cal_check_efuse(ESP_ADC_CAL_VAL_EFUSE_TP);
adc1_config_width(width);
adc1_config_channel_atten(channel_VIN, atten);
adc1_config_channel_atten(channel_EM3242, atten);
adc_chars = calloc(1, sizeof(esp_adc_cal_characteristics_t));
esp_adc_cal_characterize(unit, atten, width, 1100, adc_chars);
esp_sleep_enable_ext0_wakeup(BTN_SC, false);