Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Ctrl+A followed by Ctrl+C gets serial input stuck since 1.17 #7867

@aivarannamaa

Description

@aivarannamaa

OS: Ubuntu 20.04

Device: RPi Pico

main.py:

from machine import Pin
from time import sleep
led = Pin(25, Pin.OUT)
n = 0

while True:
    led.toggle()
    print("13 x {} = {}".format(n, 13*n)) # print the thirteen-times table
    n = n+1
    sleep(0.5)

With MicroPython 1.17, when I plug this device in, connect with tio and press Ctrl+C, then it successfully interrupts and gives me normal prompt. When I, instead, first press Ctrl+A and then Ctrl+C, then nothing happens and the input kind of gets stuck (if I do it via pyserial, then the write method blocks). Same happens when I press Ctrl+D and then Ctrl+C.

Sometimes I get out of this situation by hard-resetting Pico, but sometimes even this doesn't help and I need to either restart my computer or reset USB.

When I go back to 1.16, then this problem disappears.

This issue is relevant for Thonny IDE, because upon connecting a device, it sends Ctrl+A to probe whether the device is already idle at prompt or a process is running.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions