Is this normal ?
I am trying to achieve low power consumption in a mode but need to maintain the complete ram and task states. So I believe the light sleep is the only option for me. (correct me if I am wrong).
In light sleep I am able to achieve around .8mA current.
But problem is i2c is most of the time failing when I am in light sleep mode, If I use esp_pm_lock_acquire to prevent light sleep then it is working fine.
Is this normal ?
idf = 3.3
My code:
Code: Select all
static esp_pm_config_esp32_t pm_config = {
.max_freq_mhz =240,// CONFIG_EXAMPLE_MAX_CPU_FREQ_MHZ,
.min_freq_mhz = 10,//CONFIG_EXAMPLE_MIN_CPU_FREQ_MHZ,
.light_sleep_enable = true//true
};
esp_pm_lock_handle_t pmlock1_handle;
void app_main()
{
nvs_flash_init();
ESP_ERROR_CHECK( esp_pm_configure(&pm_config) );
esp_pm_lock_create(ESP_PM_NO_LIGHT_SLEEP, 0, NULL, &pmlock1_handle);
esp_pm_lock_acquire(pmlock1_handle); //disable light sleep at startup. Enable when ever required
.
.
.
Other than doing a recursive esp_pm_lock_acquire and esp_pm_lock_release in i2c read/write instance, is there any other way to solve this issue ?