Micropython lightsleep doesn't go into low power state on non W Pico builds

Hi

Been doing some testing with 16MB Pimoroni Pico Lipo board and low power states.
What I’ve found is all the current (up to 1.19.11) Pimoroni rolled Micropython UF2s - excluding the Pico W version - don’t properly execute the machine.lightsleep(time_ms). They do sleep for the right amount of time, but the current draw with only a battery connected should drop to ~1.4mA, but stays instead at ~22mA

If I try this on the 16MB Pico Lipo using the Pico W UF2 it does work, but I don’t see the bigger flash used by LittleFS as the standard Pico W expects a 2MB flash.

Any one else seen this, or similar results, and any forecasts for a fix?

Here’s some code to demonstrate:

import time
import machine
time.sleep(2)
led = machine.Pin(25, machine.Pin.OUT)

while True:
    led.off()
    machine.lightsleep(3000)
    led.on()
    time.sleep_ms(3000)

This should loop, powering down for 3 seconds with the LED off, and then software sleep for 3 seconds with the LED.

The vanilla Micropython Pico UF2 does work, but I need the Pimoroni flavour with built-in Picographics to support an Inky Pack ePaper display, and want all of the 16MB for record storage.
Currently I’m using the Pimoroni Pico W UF2 for the low power and Inky to work, and stuck with the smaller file system size.

Very happy with everything otherwise!

Cheers
James

Try one of these - hot off the press! Nearly 800 changes for non W boards from upstream MicroPython, so hopefully one of them concerns lightsleep :)

1 Like

That’s great - yes it works a treat on my 16MB Pico Lipo; I see all the flash using os.statvfs(‘/’) and I’m getting a machine.lightsleep(time_in_ms) current of 2.5mA.

Thanks very much for the rapid response!

Cheers
James

1 Like

Any chance of a software way to turn off the white LED? Based on the schematic and this answer from @alphanumeric it looks like I’d have to remove RN4-4.

RN1-4 as I read it, typo in your above post maybe?

image
RN4-4 is one of a 4 way resistor package, so removing this affects the red led and the flash chip select!

Easier to just lift the white Led off with a soldering iron I think, though I think you might only save 340uA or so in Lightsleep.

1 Like

@jrha nice catch. The LED is easier to find anyway. ;)

1 Like