← index #6851Issue #6998
Duplicate · high · value 4.523
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

rp2: uart.read() never returns

closedby kevinkk525opened 2021-03-05updated 2021-03-11
port-rp2

In the current implementation calling uart.read() without an expected amount of bytes will never return.
Expected behaviour: As soon as some data was read, that data should be returned.

In https://github.com/micropython/micropython/pull/6870 @robert-hh states:

When uart.read() is called without an argument, the size at the machine_uart_read() is 256.

However, I can't reproduce that. Sending over 400 Bytes in small batches or a big one still doesn't return anything.

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