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

Enable WFI for raspberrypi port #5341

Merged
merged 2 commits into from
Sep 14, 2021
Merged

Enable WFI for raspberrypi port #5341

merged 2 commits into from
Sep 14, 2021

Conversation

urish
Copy link

@urish urish commented Sep 13, 2021

Following #5331. Tested this change on a physical Raspberry Pi Pico board:

  1. I can see the CP drive in my PC
  2. I have a serial console (over USB)
  3. I can copy my code to the CP drive, it runs
  4. The code blinks the LED successfully and prints to the Serial console
  5. I can get into the REPL and type commands successfully

If you want me to do any additional testing, just let me know what else to test. Thanks!

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@microdev1 microdev1 added enhancement rp2040 Raspberry Pi RP2040 labels Sep 14, 2021
@microdev1 microdev1 linked an issue Sep 14, 2021 that may be closed by this pull request
@microdev1 microdev1 merged commit 8520c43 into adafruit:main Sep 14, 2021
dhalbert added a commit to dhalbert/circuitpython that referenced this pull request Sep 16, 2021
dhalbert added a commit that referenced this pull request Sep 16, 2021
Revert #5341. Does not work on power-cycle.
jepler added a commit to jepler/circuitpython that referenced this pull request Nov 12, 2022
This needs thorough testing before it's merged, as we tried
and reverted this once before (adafruit#5341 and adafruit#5356).

I think that besides checking for tinyusb having "something to do",
the fact that `port_interrupt_after_ticks` and `port_disable_tick`
weren't implemented that was causing a secondary problem.

I've tested this on a pico w over reboot-cycles and ctrl-c-cycles,
with and without drive automounting, with and without serial repl open,
and on a power-only connection.

I didn't notice the problem reported in adafruit#5356 after merely implementing
port_idle_until_interrupt; but I did notice that sleeps in general would
take over-long until "something" (like writing to the USB drive) happened;
I think "something" was probably calling port_enable_tick(). When this
problem was happening, sleeps would take a lot longer; for instance,
`sleep(.001)` would take about 1/20s and `sleep(.1)` would take about 1/7s.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement CPU sleep (WFI) when idle on RP2040
4 participants