← index #6851Issue #11253
Related · high · value 2.115
QUERY · ISSUE

read() & readline() on rp2 port don't work/work as expected

openby uksconeopened 2021-02-05updated 2021-02-13
port-rp2

the UART on the rp2 port mostly works. read([num of bytes]) works mostly as expected although it seems to drop bytes occasionally and "hangs" if you try to read more bytes than currently available however read() with no number of bytes to read set and readline() just sit there indefinitely. I suspect it's to do with the fact that timeout isn't implemented

CANDIDATE · ISSUE

On RP2 sys.stdin.read(64) and sys.stdin.readline() do not work if we have multiple of 64 bytes in buffer

closedby pchalaopened 2023-04-13updated 2023-04-25
port-rp2

MicroPython v1.19.1-994-ga4672149b on 2023-03-29; Raspberry Pi Pico with RP2040

Pico code:

import sys

while True:
    line = sys.stdin.read(64)
    print(len(line))

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