1 Reply Latest reply on Sep 12, 2018 7:17 AM by PY_21

    Deep Sleep wake up with WDT, incompatible with CYBLE_BLESS_DEEPSLEEP?

    jumic_1610531

                      CyBle_ProcessEvents();                      // service BLE stack events

                      CyBle_EnterLPM(CYBLE_BLESS_DEEPSLEEP);      // put BLESS into lowest power mode

                      intrStatus = CyEnterCriticalSection();      // disable interrupts

                      blessState = CyBle_GetBleSsState();         // get current BLESS state

                      if(blessState == CYBLE_BLESS_STATE_ECO_ON || blessState == CYBLE_BLESS_STATE_DEEPSLEEP)

                      {

                                      CySysPmDeepSleep();                     // 1.3uA current consumption

                      }       

                      else if (blessState != CYBLE_BLESS_STATE_EVENT_CLOSE) // BLESS is active

                      {

                                      CySysPmSleep();                         // ~1.6mA current consumption

                      }

                      CyExitCriticalSection(intrStatus);          // re-enable interrupts

       

      Looking at the code snippet above and using a PROC 4 BLE, is it right to say I cannot use the WDT to wake the device if the BLE peripheral is in Deep sleep? It will have to be a BLE event that wakes the device (i.e. advertising) because Global interrupts have to be turned off when the BLESS goes into deep sleep?

       

      If I want to wake from Deep Sleep using the WDT is it better to turn off the BLE component  with CyBle_Stop() (there are no connections), then System Deep Sleep, then wake with WDT, then CyBle_Start (). Is this my only option to wake up with a WDT?

        • 1. Re: Deep Sleep wake up with WDT, incompatible with CYBLE_BLESS_DEEPSLEEP?
          PY_21

          Hello,

           

          In the code snippet, Critical section is bound by the CyEnterCriticalSection() function at the beginning and the CyExitCriticalSection() function at the end, these two functions are used to avoid the corruption of processor state before entering into the deepsleep mode. When the system is in deepsleep mode then interrupt sources like WDT interrupt, BLESS interrupt will wakeup the device.

          If you only want the WDT interrupt to wakeup the device from deepsleep mode then you can stop the BLE before entering into deepsleep.

           

          Thanks,

          P Yugandhar.