Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 3 > Sleep/wakeup

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Sleep/wakeup
Moderator:
RKRM

Post Reply
Follow this topic



Sleep/wakeup

kristen posted on 22 Mar 2012 5:38 PM PST
Member
10 Forum 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.




Re: Sleep/wakeup

Gautam Das posted on 23 Mar 2012 11:24 PM PST
Cypress Employee
742 Forum 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).



Re: Sleep/wakeup

srim posted on 23 Mar 2012 11:32 PM PST
Cypress Employee
121 Forum 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?

 

Thanks,

SRIM

 

 



Re: Sleep/wakeup

U2 posted on 26 Mar 2012 02:08 AM PST
Cypress Employee
589 Forum 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.






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20