Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wake up by ulp from deep sleep? #2696

Open
JunfengJia opened this issue Jan 17, 2025 · 4 comments
Open

wake up by ulp from deep sleep? #2696

JunfengJia opened this issue Jan 17, 2025 · 4 comments

Comments

@JunfengJia
Copy link

My application is power-hungry, so I’m looking for a way to put the ESP32 into deep sleep and wake it up using a pin or some other logic running in the ULP. Any ideas?

@kasperl
Copy link
Member

kasperl commented Jan 17, 2025

@JunfengJia With a little bit of luck, you may not need the ULP to trigger this. Here is an example of using a GPIO pin trigger for waking up from deep sleep: https://github.com/toitlang/toit/blob/master/examples/triggers/gpio.toit.

@JunfengJia
Copy link
Author

Thanks a bunch, @kasperl! The GPIO works for me in some cases, like when the user presses a button. I’ll do more testing for other scenarios. I also created a small ulp + c program that works for the basic idea, but I’m not sure if it can also work with ULP+toit. ULP, check condition, if true, wakeup esp32, then C code do some work, then deep sleep, and ULP checking again. Do you think there’s a way to do it in ULP + toit?

@floitsch
Copy link
Member

We haven't implemented support for ULP yet.
There seems to be some interest in it, so I will try to bump its priority. Will probably still take a few weeks before I get to it.

Once implemented, your use case should be possible.

@JunfengJia
Copy link
Author

JunfengJia commented Jan 20, 2025

Hey @floitsch, thanks for getting back to me! For now, I’ll use sleep/check as a solution. Thanks again for working on it! Please let me know once it's available for test, so I can improve my design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants