Skip to content

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

@andriipv

Description

@andriipv

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugunicodeBugs and enhancements related to Unicode/UTF-8 support.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions