GPIO not waking up from DeepSleep

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Using EZ-BLE 4100 and GPIO P1(0) configured as pulled-down normally-low input with interrupt set to rising edge and attached to an isr component which is set to DERIVED, the device will not wakeup after going into deepsleep mode. In the debugger it works fine!

   

PSoC 4.0 Code segment:

   

    isr_SW_Enable();
    SW_ClearInterrupt();
    isr_SW_ClearPending();
    isr_SW_StartEx(&PowerOn);
    CyGlobalIntEnable;
    CySysPmDeepSleep();

   

I've tried changing the input to pulled up with falling edge and moving it to a different GPIO, P3(5), with no difference. Why does the same code work without any problem in the debugger but not when programmed as stand-alone?

   

ps I've decided to use deepsleep instead of the preferred hibernate due to the same problem I had with detecting the pin. What goes here?

   

Rick

0 Likes
1 Solution
Anonymous
Not applicable

Good news! This issue has been resolved:

   

Prior to going to deep sleep or hibernate it is necessary to switch over to the IMO.

   

Rick

View solution in original post

0 Likes
10 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Deep sleep does not work correctly when debugging. Additionally the chip internal debug resources use a lot of current.

   

To wake up from deep sleep use a Global Signal Reference component configured for port interrupt. The internal PICU (Port Interrupt Controller Unit) will work in deep-sleep, whilst the NVIC (Nested Vector Interrupt Controller) does not.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Thank you Bob, what you say makes sense and I tried the following without any success:

   

Deleted the 'isr_SW' from my design

   

Reconfigured the 'SW' digital input to be non-dedicated

   

Added Global Signal Reference [v2.0], named it 'WakeUp', configured to AllPortInt and named the output 'isr_SW'

   

Recompiling and the 'SW' worked correctly in operational mode but still did not wakeup after Deep-Sleep invoked.

   

No API was generated for the GSR 'WakeUp' in the generated files list

   

Rick

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Can you please post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Bob, perhaps you could detail some of the settings you are referring to. Due to the proprietary nature of the project I am unable to post it.

   

Rick

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Build a new project that shows th issue (or solves it), then post this example. All other is guessing...

   

 

   

Bob

0 Likes
Anonymous
Not applicable

Using the Hibernation example as a basis, I constructed a small test scenario which exercised both Deep Sleep and Hibernation with the isr_SW alternating between the 2 prior to pm mode command. Using the same file structure as in my full project and I/O's as in my full project. This test project works without any problem. Being extremely careful to assure that my full project had all the same characteristics as the test project, I still see it work properly when compiled as debug and not work when compiled as stand alone. The ISR never begins when the SW is exerted in stand alone, but does when compiled in debug mode. A hardware interrupt such as the WDT has no problem waking up the device in Deep Sleep mode.

   

What is inherently different when compiled in debug than when in stand alone that could be causing this different behavior?

0 Likes
Anonymous
Not applicable

A little additional information/observations: I'm using the development kit connected to my test board thru the J11: VDD, GND, RST, SWDCLK & SWDIO pins. If the project is compiled in debug mode, the ISR is called properly during debugger run and stop modes. If the reset (SW1 on the development board) is pressed, it reverts back to not running the ISR. Therefor there must be some interaction with the U12 module's mode of operation from debugger to reset.

   

I've experimented with all the compiler optimization modes with no difference in the problem occurring.

   

Any insight would be helpful.

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Here is the test file I used to determine if things worked (and they did)

0 Likes
Anonymous
Not applicable

Good news! This issue has been resolved:

   

Prior to going to deep sleep or hibernate it is necessary to switch over to the IMO.

   

Rick

0 Likes

i tried creating the GSR and also had no generated source, does anyone know if this is expected?

Having the same issues as above, my external device is clearly giving a pulse, but the hibernate and deepsleep will not respond.

WDT will kick them off.

Herb

0 Likes