← index #14079Issue #15129
Off-topic · high · value 4.438
QUERY · ISSUE

Rp2: Incorrect CPU freq after lightsleep()

openby mungewellopened 2024-03-13updated 2025-03-03
bugport-rp2

Checks

  • I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.

  • I've searched for existing issues matching this bug, and didn't find any.

Port, board and/or hardware

rp2 - official Pico (non-wifi)

MicroPython version

MicroPython v1.22.2 on 2024-02-22; Raspberry Pi Pico with RP2040

Reproduction

Run a short script to enter/exit lightsleep(), checking CPU freq afterwards show that it has changed.

MPY: soft reboot
CPU Freq 100000000
entering lightsleep
wake from sleep
CPU Freq 125000000

blink.py.txt

Expected behaviour

Expect it not to change...

Observed behaviour

CPU freq reports differently to that previously set.

Additional Information

No, I've provided everything above.

CANDIDATE · ISSUE

if uart receives 0xf0 byte then mcu after entering lightsleep never wakes up

openby andriipvopened 2024-05-26updated 2025-08-26
bugunicode

Checks

  • I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.

  • I've searched for existing issues matching this bug, and didn't find any.

Port, board and/or hardware

RP2, STM32L4, STM32H7

MicroPython version

MicroPython v1.22.2 on 2024-02-22; Raspberry Pi Pico with RP2040

Reproduction

Example for Rpi Pico:

from machine import Pin, UART, lightsleep
from time import sleep

uart = UART(0, baudrate=115200, bits=8, tx=Pin(0), rx=Pin(1), parity=None, stop = 1, timeout=2000)

## Main Loop ##
uart.write("Start \n")

while True:
    sleep(1)
    buff=bytearray()
    while uart.any():
        buff.extend(bytearray(uart.read(uart.any())))
    # to exit program send '9'
    if buff.find(b"9")>=0:
        break 
    
    if len(buff)>0:
        buff.append(10)
        uart.write(buff)
    uart.write("before lightsleep \n")
    lightsleep(100)
    sleep(0.05)
    uart.write("after lightsleep\n")

Expected behaviour

No response

Observed behaviour

If uart receives 0xf0 byte then mcu after entering lightsleep never wakes up.
If message doesn't have 0xf0 byte then it continues working ok.

I tried it on RPi Pico, and STM32 boards they have same behavior.

Additional Information

No, I've provided everything above.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied