i2c failing most of the time when light sleep is enabled and min freq 10MHz

vinodstanur
Posts: 27
Joined: Thu Jun 08, 2017 12:59 pm

i2c failing most of the time when light sleep is enabled and min freq 10MHz

Postby vinodstanur » Wed Mar 25, 2020 9:20 pm

My i2c is failing when I am enabling light sleep.

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
   .
   .
   .
   
 
I have a fuel-gauge task which is supposed to run all time at every 5 seconds. But asynchronously I may do esp_pm_lock_release to reduce current consumption. But at this time when my I2C is running, it is returning failure most of the time. Seems like in light sleep i2c seems to be not performing properly.
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 ?

Who is online

Users browsing this forum: Baidu [Spider] and 123 guests