-
-
Notifications
You must be signed in to change notification settings - Fork 40.6k
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
[Bug] RP2040 cannot wake from S3 Sleep #19663
Comments
Mentioning @npross because they described running into similar issues with a Sofle using rp2040 microcontrollers in another issue. |
It seems the Adafruit RP2040 Macropad didn't have this issue after applied KarlK90's fix, it can wake my PC up from S3...I will double check if I put it into S3 or not once I got home today. |
@scchow Thanks, I have done more testing and @KarlK90's fix resolves the issues. Makes sense because waking from sleep often was after a long delay, Thanks Stefan and Scott. |
Thanks for the updates. I'll try testing my setup on a different computer and let you know how it goes. |
I found that if I add Shows that maybe the board fails to send keypresses to the computer once the computer enters this particular state of sleep? However, I can wake the computer by pressing any key on a different board or clicking the mouse. Also, just wanted to note that I am able to use this keyboard on startup to navigate the BIOS and GRUB, so it seems to be a purely a sleep issue. |
I could also not wake my macOS from sleep with a Tofu Jr (RP 2040). |
I merged #19780 into my development branch. Unfortunately, I am still running into the wakeup issue. |
Could you add |
Still no dice with Something interesting I noticed is if I plug and replug my keyboard while the computer is asleep, my keyboard enters an unresponsive state (RGB animation of the master side working, but RGB on other side, keypresses, and OLEDs not responding) until I unplug/replug again, even if I wake my computer with another device in the meantime. Don't know if this is useful information, just noting it here in case it sparks some ideas as to what may be happening. |
This is very strange indeed. Did you also update your submodules, especially ChibiOS-Contrib to the latest state? |
Did a quick One change I did see is when doing the replug test, RGB animations now work on both sides, but the OLEDs and keypresses are still unreponsive. |
One more try. Could you compile the rp2040 onekey with the fix and latest submodule and see if this is also unable to wake up the host? In the future I have to get myself a real windows machine and try to replicate this error. |
Assuming you're talking about this when you mention rp2040 onekey? Just making sure, I am using an Elite-Pi which has this pinout. Would bridging pins D4 and D5 cause a keypress? (Are they equivalent to the GP4/GP5 pins that is mentioned in the one-key readme?) |
@scchow sorry for the late reply. Yes I meant the referenced |
@KarlK90 Finally got around to testing the handwire/onekey. I worked on the same branch with the fix and submodules. I built and flashed the Unfortunately I encountered the same issue where I was unable to wake the computer from sleep using the onekey. |
One more thing, If you have selective usb suspend enabled under Windows - could you disable it as see if this changes anything? I try to get a hold on a real Windows 11 machine in the meantime. |
@scchow So good news: I can reproduce the issue with a W11 laptop that I borrowed. Bad news: I can reproduce the issue 😛. I'll investigate and let you know what I've found out. |
Good to hear the problem is not localized to my setup 😅
I tried disabling selective usb suspend, but that did not change anything. |
I compiled the development branch today. Seems to not fix my problem with the Tofu Jr. |
@scchow @kmplngj @npross @ForsakenRei complete plot twist on the S3 fix which now allows the keyboard to wake my W11 and Linux machine just fine. Technically I've removed the forced restart of the USB driver in the last iteration of the fix #19780. Could you try if this works as well for you? I'm especially interested if this also works on Mac. |
@KarlK90 So good news and bad news. Good news is I rebased #19780 into my branch and am happy to report that I could wake my computer up with my rp2040 board! Bad news is that after the computer wakes up, my board is frozen, and I have to replug the board to get it to respond again. All RGBs and OLEDs remain dark and the board is unresponsive as though it is stuck in sleep. I tried setting It is interesting to note that the board itself is frozen, as the WPM counter on the OLEDs does not change even when I press keys on the board. You can see state of my branch here. Thanks for your help with debugging this issue! |
@scchow I've found the root cause of the failing in resume and posted a fix to the RP2040 usb driver in ChibiOS/ChibiOS-Contrib#365 the same bug affects STM32f4xx mcus and I've posted a patch on ChibiOS discord. Could you checkout the ChibiOS branch with my fix and test if this fixes your board freezes? I've tested it with W11 and Linux and it works flawless on my side. |
@KarlK90 I merged your ChibiOS-Contrib fork into the current branch of qmk/ChibiOS-Contrib and am happy to report I can now wake my computer from sleep and resume without freezing! I did want to point out that I could not just check out your branch, because it seems like your rp2040-remote-wakeup branch is a couple commits behind the main ChibiOS-Contrib 21.11.x branch, which caused a couple of compilation errors. Might want to rebase your branch to the current head. Thank you for all the help in debugging and fixing this issue. Have a great day! |
You're welcome and that is great to hear, so no more hacks required. I've also rebased my fix branch, totally missed that it is based on a old one. |
@scchow @KarlK90 hello,after reading your discussion and updating my file ,this bug seems to be perfectly solved.but i found a strange situation on macbook today, if I define RGBLIGHT_SLEEP, rgb leds will turn off after pc sleep, but after waking up ,all keys can't input, I have to replug the keyboard. If I don't define RGBLIGHT_SLEEP, the rgb won't turn off after the pc sleep, but I won't need to replug the keyboard for normal use. when i use this board(rp2040) with windows pc and everything works fine. |
I have a similar problem as @bdtc123 but I am on a DELL laptop. If I let my laptop hibernate or power down, when I restart I cannot use the keyboard without resetting or replug. I applied @KarlK90s recent changes anyway even though i suspected they would not apply). |
I'm on the latest Fedora, with a keyboard that has a sea-picro (pro micro clone), and also have this issue. |
With #19780 merged this issue should be solved now on the latest |
Describe the Bug
My RP2040-based board cannot wake my computer from S3 sleep on Windows.
I suspect it has to do with the rp2040-based microcontroller I am using, because my other boards that are not rp2040-based do not have this issue.
Steps to Reproduce
Start Menu -> Power -> Sleep
Expected behavior
Computer should resume from S3 sleep and the login page should be displayed
Actual behavior
Keyboard
I am seeing this problem on the Sofle v3.0 RGB split keyboard with a pair of Elite-Pi rp2040-based microcontrollers and ssd1306 OLEDs.
I am using my own keymap that can be found in my fork here.
Related Issues
Keyboard Used
sofle/rev1/scchow
Link to product page (if applicable)
Sofle Keyboard
Operating System
Windows
qmk doctor Output
Is AutoHotKey / Karabiner installed
AutoHotKey is installed, but unrelated to this issue.
Other keyboard-related software installed
No response
The text was updated successfully, but these errors were encountered: