2 Replies Latest reply on Mar 17, 2015 12:01 AM by user_65808856

    GPIO state in deep sleep

    user_65808856

      You state that:

      GPIOs that are output enabled will remain so and drive as configured in sleep/deep sleep in Sleep Deep_Sleep Explanation and Techniques

      We tested this with our BCM20736 device and it looks like it does not work. We set one GPIO as output/high. As soon as the device enters deep sleep the GPIO goes low.

      We are using SDK 2.1.1 and the following code snippet taken from etc_sample.c:

       

      gpio_configurePin(0, 3, GPIO_OUTPUT_ENABLE, GPIO_PIN_OUTPUT_HIGH);
      ble_trace1("Entering deep sleep. Will wake up in %d seconds...", 10000);

       

      gpio_configurePin(0, 0, 0x100, 0);

       

      // Configure the low power manager to enter deep sleep.
      devLpmConfig.disconnectedLowPowerMode = DEV_LPM_DISC_LOW_POWER_MODES_HID_OFF;

       

       

      // Configure the wake time in mS.
      devLpmConfig.wakeFromHidoffInMs = 10000;

       

       

      gpio_configurePin(0, 0, 0x100, 0);

       

       

      // Enter deep-sleep now. Will not return.
      devlpm_enterLowPowerMode();

       

      When the device is in deep sleep mode then GPIO P3 is low. But it should be high.

      Why is this so?

        • 1. Re: GPIO state in deep sleep
          ArvindS_76

          Register for callbacks to the enter/abort hid-of (deep sleep) callbacks and provide an empty implementation for these:

           

          void application_create(void)

          {

              // all other init

              bleprofile_regAppEvtHandler(BLECM_APP_EVT_ENTERING_HIDOFF, (BLECM_NO_PARAM_FUNC)app_enter_hidoff);

           

              bleprofile_regAppEvtHandler(BLECM_APP_EVT_ABORTING_HIDOFF,(BLECM_NO_PARAM_FUNC)app_abort_hidoff);

          }

           

          void app_enter_hidoff(void)

          {

              // Do nothing.

          }

           

          void app_abort_hidoff(void)

          {

              // Do nothing.

          }


          There is a bug in the default implementation of the callback in the ROM where it is input enabling all IOs.

          • 2. Re: GPIO state in deep sleep
            user_65808856

            Thanks, arvinds! This indeed fixes the issue!