1 Reply Latest reply on May 22, 2020 5:53 AM by SudheeshK_26

    PSOC4BLE WDT INTERRUPT CAN NOT WAKE SLEEP

    user_264721

      Hi CY Friend,

       

      As the title. I attach my code.

       

      Thanks

      sophie

        • 1. Re: PSOC4BLE WDT INTERRUPT CAN NOT WAKE SLEEP
          SudheeshK_26

          Hello,

           

          As per my understanding, you want o use WDT interrupt to wake up CPU from sleep periodically. Please correct me, if I am wrong.

           

          In the project that you attached, CySysWdtDisable(CY_SYS_WDT_COUNTER2_MASK) is called periodically in the for() loop in the main function. The function CySysWdtDisable() will disable WDT counters and they won't generate an interrupt. Also, the function to enable WDT counters is commented out CySysWdtEnable(CY_SYS_WDT_COUNTER2_MASK). You have to call this function to start WDT counters. Please test again after modifying your main() function as below and let me know the results.

          int main()
          {
              CyGlobalIntEnable; /* Enable global interrupts. */
              
              WdtIsr_StartEx(WdtIsrHandler);
              /* Place your initialization/startup code here (e.g. MyInst_Start()) */
              CySysWdtWriteMode(CY_SYS_WDT_COUNTER2, CY_SYS_WDT_MODE_INT);
              CySysWdtWriteToggleBit(22);//32s
              
          //    CyBle_Start(AppCallBack);
              CySysWdtEnable(CY_SYS_WDT_COUNTER2_MASK);    
              Uart_PutString("Start!\r\n");
              for(;;)
              {
          //        CyBle_ProcessEvents(); 
                  /* Place your application code here. */
                          
          //        ManageBlePower();
              
                  /***********************************************************************
                  *  Run your application specific code here
                  ***********************************************************************/  
          //        if(applicationPower == ACTIVE)
          //        {
          //            RunApplication();
          //        }
          //        
          //        /***********************************************************************
          //        *  Process application power modes
          //        ***********************************************************************/
          //        ManageApplicationPower();   
          //        
                  /***********************************************************************
                  *  Manage system power mode based on application and BLE power modes
                  ***********************************************************************/
          //        ManageSystemPower();
                  CySysPmSleep();
                  Uart_PutString("test\r\n");
                  CySysWdtResetCounters(CY_SYS_WDT_COUNTER2_MASK);
             }
          
          }
          
          
          

           

          Thanks and Regards,

          Sudheesh