Skip to content

Asyncio hangs after soft reset. #7252

@m1cha1s

Description

@m1cha1s

CircuitPython version

Adafruit CircuitPython 8.0.0-beta.4 on 2022-10-30; Raspberry Pi Pico W with rp2040

Code/REPL

import board
import digitalio
import asyncio

async def blink(pin, interval):
    with digitalio.DigitalInOut(pin) as led:
        led.direction = digitalio.Direction.OUTPUT
        while True:
            led.value = not led.value
            await asyncio.sleep(interval)


async def main():
    print("Started")
    t1 = asyncio.create_task(blink(board.LED, 1))
    t2 = asyncio.create_task(blink(board.GP0, 1.01))

    await asyncio.gather(t1, t2)
    print("Done")

asyncio.run(main())

Behavior

After some amount of soft resets(it's seemingly random) it just hangs and does not respond or responds very very slowly. It is fixed after a hard reset(power off than on)

Description

No response

Additional information

It works fine if i force the library(asyncio) to use the python version instead of _asyncio

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions