The issue is present in IDF 3.1.1 and 3.0.x versions as well; there likely exists a version on 3.0 branch which does not have the issue, but i can't say for sure which one is that.
Regarding adc_power_off not having effect, here's the code i used to test.
If I remove the adc_power_off line, then current is 1.4mA. If i add it back, current is 5.5uA.
Please check with this code sample to see if your issue is the same or not.
Code: Select all
#include "freertos/FreeRTOS.h"
#include "esp_wifi.h"
#include "esp_event_loop.h"
#include "nvs_flash.h"
#include "esp_sleep.h"
#include "driver/adc.h"
static void wifi_start_stop(void)
{
ESP_ERROR_CHECK(nvs_flash_init());
tcpip_adapter_init();
ESP_ERROR_CHECK(esp_event_loop_init(NULL, NULL));
wifi_init_config_t cfg = WIFI_INIT_CONFIG_DEFAULT();
ESP_ERROR_CHECK(esp_wifi_init(&cfg));
ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_STA));
ESP_ERROR_CHECK(esp_wifi_start());
vTaskDelay(pdMS_TO_TICKS(1000));
ESP_ERROR_CHECK(esp_wifi_stop());
ESP_ERROR_CHECK(esp_wifi_deinit());
}
void app_main()
{
wifi_start_stop();
/* The following line is necessary to reproduce the issue;
* An alternative way is to enable ext0 wakeup.
*/
esp_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_ON);
/* powering down ADC before entering sleep works around the issue */
adc_power_off();
esp_deep_sleep_start();
}