You are here

Sleep/wakeup | Cypress Semiconductor


Summary: 3 Replies, Latest post by U2 on 26 Mar 2012 04:08 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
kristen's picture
10 posts

 Hi again,

We are experiencing a very strange problem with the PSoC3. The device appears to successfully go to sleep and then wake up when it receives a pulse on a designated GPIO. The ISR connected to that pin then fires and executes successfully (we can see all of this in the debugger). On exiting the ISR though, the program enters an unknown state. We have discovered that the program in fact gets stuck in a function inside a switch-case in the main loop. The case that it gets stuck in though is not the expected case. In fact when I view the switch variable in the debugger it is not equal to the case that the program has entered. I have provided some of my code and my hardware setup to help illustrate. I have also pointed out where the program counter jumps to unexpectedly.

dasg's picture
Cypress Employee
730 posts

Hi kristen,


1) Does any of the ISR manipulate the value of the variable "state"?

2) What is done in the ISR associated with the PICU interrupt? Restoring the clocks in that ISR seems more intuitive.

3) When the device is in Sleep mode, the IMO is turned off. So, running the device in Debug mode is not possible while in sleep. Please verify if the chip functionality is as expected when it is run normally (without running in "Debug" mode).

srim's picture
Cypress Employee
111 posts

I had a glance at the attached code. Although I could not find the exact issue at this point, I would suggest you to try the following things.

I see that you are enabling the ISR and calling a while loop after saving clocks using CyPmSaveClocks() API. It is advisable to call CyPmSleep( ) soon after saving clocks and not to do any other functions as all the pheripheral clocks are off and could result in undesirable results. Also restore clocks as soon as the part wakes up.

CyPmReadStatus() is not necessary as the part is not waking from a CTW event.

Try keeping all component wake-up APIs outside the interrupt routine (writing soon after the restore clocks in main.c) and 

thereby using ISR rotine only to clear interrup status bits/ setting flag etc..

If possible, can you attach the project here so that I can relook where exactly its goin wrong?






uday's picture
Cypress Employee
569 posts

I would suggest you to upload your project here, so that we get a complete poicture of your picture. We can suspect few things but we can not zero in on the root cause without your complete project.

Log in to post new comments.