5 Replies Latest reply on Jun 6, 2017 12:51 PM by userc_38583

    GPIO Interrupt won't wake from DeepSleep

      I'm working with a CYBLE-022001-00 PROC module and have been struggling trying to solve a problem where I can't get the CPU to wake from deep sleep with a GPIO interrupt.


      With the following code, I have an input configured to interrupt on falling edge, and have the pin configured with a pullup.  There's also a pin configured as an output and I toggle its state in the ISR...watching it on a scope.


      With the following code, the output toggles each time I ground the input which shows me the ISR is working as expected.


      However, if I change the CySysPmSleep() to CySysPmDeepSleep(), it stops working.  It's not waking from deep sleep.  Can anyone confirm that this can be done on this module?




          if(out_on == 0)
              out_on = 1;
              out_on = 0;


      int main()



        • 1. Re: GPIO Interrupt won't wake from DeepSleep

          Here is a chart on Sleep and what is working when you are in various sleep types. Also some information on interrupts .


          • 2. Re: GPIO Interrupt won't wake from DeepSleep

            Thanks.  I think I understand what works in various modes, and how to setup the interrupt.  Changing from sleep to deep sleep with a working interrupt configuration causes my test to stop working.  This leads me to believe there's something I'm missing about going into deepsleep, or the module I'm designing around doesn't behave the way it should.  I was asking if anyone has this working.

            • 3. Re: GPIO Interrupt won't wake from DeepSleep

              Because there is no high-speed clock available in deep sleep the interrupt controller does not work. Instead the "Global Signal Reference" component can be used to generate an interrupt on (any) port interrupt in deep sleep mode.





              • 4. Re: GPIO Interrupt won't wake from DeepSleep

                Hi there!


                I had the same problem and Cypress support helped me to find a solution. You need to place a Global Signal Reference block and configure it to generate a Combined port interrupt (as Bob said).



                You then need to determine which GPIO triggered the interrupt (if you have more than one source). Here is a code example that may help. In this example, one source is on P3.4 and the other is on P3.7:






                    // Accelerometer INT 1 rising edge interrupt?


                    if((* (reg32 *) CYREG_GPIO_PRT3_INTR)& (1<<4))










                    // User button rising or falling edge interrupt?


                    if((* (reg32 *) CYREG_GPIO_PRT3_INTR)& (1<<7))












                   Start port wide interrupt to wake up CPU from Deep Sleep when a GPIO interrupt occurs.


                    Port wide interrupt handler will determine which interrupt handler must be called.








                Good luck!








                • 5. Re: GPIO Interrupt won't wake from DeepSleep

                  That did it...thanks so much.  Would have never realized that without your help.


                  It's funny, I'm working on an accelerometer application too.  I noticed that in your code.  NXP by any chance?