3 Replies Latest reply on Sep 20, 2018 11:25 PM by nsha

    Power Management_Hibernate trying with watchdog timer

    abhishek.kumar_3704436

      Hi All,

       

      I have tried the power management_Hibernate code example for psoc5 lp family. I am using it in my Cy8c5888LTI-LP097 controller. I am able to go in hibernate mode without watchdog reset but when i try the same code example with watchdog timer, it is not working with it.. I already tried

       

              CyWdtStart(CYWDT_1024_TICKS,CYWDT_LPMODE_DISABLED); and

       

              CyWdtStart(CYWDT_1024_TICKS,CYWDT_LPMODE_MAXINTER);

      API so that it will stop the watchdog in hibernate and sleep mode but it is not working in my case.

      this is my case i am clearing WDT before entering hibernate mode.

       

      if(Pin_1_Read() == 0) {

                  /* Turn off LED to indicate Hibernate mode */

                  LED_P1_2_Write(0u);

                  CyWdtClear();

                  /* Prepare system clocks for the Hibernate mode */

                  CyPmSaveClocks();

                 

                  /* Switch to the Hibernate Mode */

                  CyPmHibernate();

                  /* Restore clocks' configuration */

                  CyPmRestoreClocks();

                  LED_P1_2_Write(1u);

              }

       

      Any suggestion in this case.

      Thanks in advance...

       

      Regards
      Abhishek

        • 1. Re: Power Management_Hibernate trying with watchdog timer
          nsha

          Hello Abhishek,

           

          Could you please check the attached project?

          I programmed the attached project in CY8CKIT-050 and at my end, WDT is not reset and is disabled in hibernate mode as expected.

           

          Thanks,
          Shanmathi

          • 2. Re: Power Management_Hibernate trying with watchdog timer
            abhishek.kumar_3704436

            Hey Shanmathi

             

            Thanks for the reply and you time. I already tried this and it is working fine with the code example but when I tried it in my code in which i have RTOS, USB Uart,scheduler but it is not working in my code

            Below is my function in which i am changing the bode:

             

              void Jump2Hibernate()

            {  

                CyWdtClear();

             

                /* Prepare system clocks for the Hibernate mode */

                  StopSchedulerALL();

                vTaskEndScheduler();

             

                CySysTickDisableInterrupt();

             

                CyPmSaveClocks();

                CyWdtClear();

                /* Switch to the Hibernate Mode */

                CyPmHibernate();

                /* Restore clocks' configuration */

                CyPmRestoreClocks();

                CySoftwareReset();

            }

             

            I am doing software reset here because if I don't do it my code stuck here and I am not able to use my console. I know I should not do reset because in hibernate code starts from the same place where it stops but not in my case there is something I missing. I not able to get that. Please have a look on my function which I shared above and please help me. Do I need to stop something else before moving to hibernate mode.

             

             

             

            Thanks

            Abhishek

            • 3. Re: Power Management_Hibernate trying with watchdog timer
              nsha

              Hi Abhishek,

               

              Could you please elaborate more on the issue you are facing?

               

              I assume the following. WDT is disabled in hibernate mode. But in your code, WDT seems to reset the system before the system even enters hibernate mode.

              If that is the case, you can clear the WDT frequently in a high priority task, so that WDt does not reset the system.

               

              Is your system entering hibernate mode? Please confirm if you are checking the current consumed.

              Also, what is the expected scenario after exiting from hibernate mode? What is the outcome in your project and code example, at your end?

               

              Thanks,
              Shanmathi

              1 of 1 people found this helpful