cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ 5, 3 & 1

RiMo_301056
New Contributor II

Hi all,

I got stuck trying to get sleep / wakeup running on a PSoC3.

It seems that the device goes to sleep correctly, as I do this:

  • sleep components that have API functions to do so
  • call CyPmSaveClocks();
  • CyPmSleep(PM_SLEEP_TIME_NONE, PM_SLEEP_SRC_PICU);   // allow wake from PICU

I use a GPIO input pin as the wakeup source. I have set up an ISR routine associated to that GPIO. After a wakeup, I do the following:

  • CyPmRestoreClocks()
  • wake components
  • clear GPIO pin interrupt (that caused the wakeup)

I implemented the GPIO and related interrupt as suggested in the example project "PowerManagement_Hibernate" provided in PSoC Creator (and also available as a download from the Infineon website as sample project CE95346), with the only difference that I do not put the device to Hibernate, but to Sleep.

Screen Shot 2021-11-23 at 12.34.41.png

I could successfully test the "PowerManagement_Hibernate" example project on my hardware, but only after removing the MiniProg3 debugger. When the MiniProg3 is connected, the example project does not seem to work. I'm wondering if removing the debugger is a requirement and why it is not clearly stated in the example's description??

In my project (that sends the PSoC to sleep instead as to hibernate) when I press the button connected to the GPIO pin, the device wakes up, but seems to become unresponsive (apparently executing some random code). 

I have read various documents, such as the pdfs provided in AN77900AN66083 and many more.

But still, I have a few unanswered questions:

  • In the AN77900 example, there is no ISR associated to the GPIO pin connected to the button which is supposed to wake up the PSoC. How does the PSoC know which ISR it should run when the button is pressed, therefore issuing an interrupt? There seems to be a confusion with the fact that the pin properties (in the schematic) indicate that the GPIO input pin has its interrupt enabled. On the other hand, there is no ISR handler defined and associated to it.
  • I read here that apparently, it is not possible to use the debugger (MiniProg3 in my case) when debugging a PSoC3 that goes into sleep mode. There seems to be an issue with the fact that the IMO clock needs to be kept active for debugging (?). I found it very strange that nowhere in the Community the question: "Can we use the MiniProg3 with projects that send the PSoC3 to sleep (or hibernate)?" is answered. At least, I couldn't find it.
    Can anyone please give me a clear answer?
    If the answer is "NO" (i.e. debugging not possible when entering low power modes), is there a workaround (e.g. a way to keep the IMO clock alive during sleep) to have the possibility to continue using the debugger (obviously at a greater current consumption) just to debug the code and make sure that everything works ?
  • Were can we find a complete documentation about the API functions provided in cyPm.c, CyLib.c, CyUtils.c, etc... and all other files provided in cy_boot in the project tree?
    I found something (but not all) in the pdf provided with AN77900, but I'm not sure if there is a better place?

Thanks for all your suggestions!

 

0 Likes
3 Replies
Alakananda_BG
Moderator
Moderator

3)Were can we find a complete documentation about the API functions provided in cyPm.c, CyLib.c, CyUtils.c, etc... and all other files provided in cy_boot in the project tree?
I found something (but not all) in the pdf provided with AN77900, but I'm not sure if there is a better place?

>>You can refer to the system reference guide for more information regarding the API functions

https://www.cypress.com/file/274561/download

We will get back to you on the other questions shortly.

Regards

Alakananda
0 Likes
RiMo_301056
New Contributor II

Deas Alakananda,

thank you very much for the answer to my question #3.

The document that you indicated indeed contains useful descriptions for all API functions found in the cy_boot folder.

However, I am still awaiting an answer from Infineon's technical staff about my other two questions (#1 & #2).
Especially, the question #2 about how to debug a project that occasionally sends the PSoC to sleep has become very crucial to me.

Thank you for a quick reply.

0 Likes
Alakananda_BG
Moderator
Moderator

Hi,

Can you let us know what exactly you want to debug  and you can use the attach to running target option when device wakes up to observe what went wrong or what exactly you want to observe.

Regards

Alakananda
0 Likes