pico-extras icon indicating copy to clipboard operation
pico-extras copied to clipboard

Update pico_sleep

Open peterharperuk opened this issue 1 year ago • 1 comments

Fixed to work for RP2040 and RP2350 using pico_aon_timer.

peterharperuk avatar Aug 08 '24 19:08 peterharperuk

Is there any chance that this update fixes the problem with locking up the pico after repeatedly calling stdio_init_all(); or stdio via USB that stops working after waking up? See this issue for some of the attempts to find a solution: https://github.com/raspberrypi/pico-extras/issues/41

pspeybro avatar Sep 23 '24 22:09 pspeybro

I'm going to merge this...

peterharperuk avatar Nov 08 '24 10:11 peterharperuk

Many thanks for looking into this!! Can anyone confirm that the code is working for the Pico 2 (RP2350)? For me, the examples in pico_playground work nicely for the RP2040 (Pico), but not for the Pico 2 - it does not wake up. I can see however that the current consumption on the Pico 2 drops a lot when put to sleep, so the problem appears to be in the wake up part.

Lecostarius avatar Nov 14 '24 15:11 Lecostarius

They worked for me! I pushed an update to pico_playground - can you check you have this change?

commit 3b2267d539738a36c054b93fad0715c3b2ee456f Merge: 9930bb0 54e7410 Author: Peter Harper [email protected] Date: Mon Nov 11 10:29:12 2024 +0000

Merge pull request #48 from peterharperuk/sleep_rp2350

Update pico_sleep examples

peterharperuk avatar Nov 14 '24 15:11 peterharperuk

OK, just saw your reply a moment ago. I will check it out and let you know. Thanks for the answer!

Lecostarius avatar Nov 17 '24 22:11 Lecostarius

I think I have used the latest update, but still no luck with pico2. I succeeded with switching it off completely using powman and it wakes up again, which is also solving my problem. I should note that I was using the Arduino IDE for that which most likely is not a good idea.

Lecostarius avatar Nov 22 '24 17:11 Lecostarius

@Lecostarius There are a few sleep examples, sleep and dormant, are none of them waking up? They should wake up when an interrupt goes off - it's odd that this wouldn't happen. Usually they don't go to sleep.

peterharperuk avatar Nov 22 '24 17:11 peterharperuk

They work on Pico. On Pico2, no wakeup. I could get the powman based example in pico-examples to work on the Pico2 though - shutdown and wakeup both work.

Probably the problem sits in front of the computer... if I find the time I will write an update here, but for now, I will go with the powman based shutdown.

Lecostarius avatar Nov 22 '24 17:11 Lecostarius