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

Problem with UART in hello_sleep example #17

Open
ms1963 opened this issue May 1, 2021 · 3 comments
Open

Problem with UART in hello_sleep example #17

ms1963 opened this issue May 1, 2021 · 3 comments

Comments

@ms1963
Copy link

ms1963 commented May 1, 2021

I am currently experimenting with the sleep/dormant modes of the Raspberry Pi Pico. As a base I am using the examples hello_sleep respectively hello_dormant. The problem I encountered: After going to sleep, no printf() statements will be printed to the uart.

The only text I'll ever see using a serial monitor is the following:
[Connected]
Hello Sleep!
Switching to XOSC

I am using a Mac. Thus, I don't know whether Windows 10 and Linux have the same issue.
Is there anything I need to consider when sleeping or recovering from sleep? Saving the clock registers before sleep and restoring them after sleep did not work either.

@RayNieport
Copy link

I have the same issue while monitoring stdio via USB on Windows 10. Dormant mode appears to shut down things without properly re-enabling them on wake-up.
I implemented the recover_from_sleep function found here, but while that does fix some issues and appears to bring the clocks back up, it does not fix the USB and allow stdio to display on my monitor via PuTTY.

@lurch
Copy link
Contributor

lurch commented Aug 18, 2022

This is just a random guess (and may not actually be anything to do with your problem at all), but I wonder if Windows might be "getting confused" by the USB device suddenly becoming non-responsive, when the RP2040 goes to sleep?

@RayNieport
Copy link

Windows does seem to get confused, but I think this is more of a Pico issue than a Windows issue. I would think that a proper "wake up" after going dormant should reinitialize USB in such a way that Windows could recognize the device again. And as mentioned above, this also seems to be an issue on Mac. I've monitored the system clocks and by default the USB clock stays at 0Khz after waking up from dormant.

I tried to restore this manually but setting the clock back to its original value doesn't seem to be enough to get the connection working again.

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

No branches or pull requests

3 participants