6 Replies Latest reply on Nov 15, 2018 12:12 AM by ChSa_3356871

    Wakeup from System Deep Sleep by WDT sometimes fails

    ChSa_3356871

      Hello,

       

      we were planning to put the System into Deep Sleep mode by calling Cy_SysPm_DeepSleep(CY_SYSPM_WAIT_FOR_INTERRUPT) on both CPUs. The system should then wake up after a short time using a WDT.

       

      Most of the time this seems to work, and the status returned by Cy_SysPm_DeepSleep() is always CY_SYSPM_SUCCESS.

      Sometimes though the system keeps hanging in deep sleep without waking up. We were able to resume it in such a case by attaching the debugger, after which the result status is still CY_SYSPM_SUCCESS.

       

      The following piece of code is used to configure the WDT and put the CM4 into deepsleep (CM0 is in permanent Deep Sleep in the application):

       

          // configure the WDT interrupt
          cy_en_sysint_status_t sysint_status = Cy_SysInt_Init(&WDTIsr_cfg, WDTIsr);
          if(sysint_status != CY_SYSINT_SUCCESS) {
              mDEBUG_PRINTF("ISR ERROR\n");
          }
          
          NVIC_EnableIRQ(srss_interrupt_IRQn);
          Cy_WDT_Init();
          Cy_WDT_UnmaskInterrupt();
          Cy_WDT_SetIgnoreBits(4);
          Cy_WDT_Unlock();
          Cy_WDT_Enable();
          __enable_irq();
          cy_en_syspm_status_t status = Cy_SysPm_DeepSleep(CY_SYSPM_WAIT_FOR_INTERRUPT);
          mDEBUG_PRINTF("Woke from DS with status: %X\n", status);
      
          Cy_WDT_Unlock();
          Cy_WDT_Disable();
          __NVIC_DisableIRQ(srss_interrupt_IRQn);
      

       

       

       

       

      Thanks,

      Christoph