Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5308

General • Re: Communication between RPI5 and Pico over UART0

$
0
0
Hello!
I'm sorry for the late answer, but I was able only now to find some time to invest in this issue.
I'm trying to communicate over serial line (uart0) between a rpi pico and a rpi4 running
Linux raspberrypi 6.6.31+rpt-rpi-v8 #1 SMP PREEMPT Debian 1:6.6.31-1+rpt1 (2024-05-29) aarch64 GNU/Linux
.

Pico firmware has been rebuilt enabling uart0

When I use minicom to control the serial port, everything works fine. I run
minicom -o -b 115200 -D /dev/serial0
on the RPI4 and I get the REPL

However, I always fail if I try to open the serial port using python code

Code:

from machine import UART, Pinimport timeprint("Ok")time.sleep(1)uart0 = UART(0, baudrate=115200, tx=Pin(0), rx=Pin(1))print("Ok2")
Specifically, I get the first OK printed, but not the second.

What am I doing wrong here? Any help will be greatly appreciated.

Statistics: Posted by psereni — Wed Jun 26, 2024 1:18 pm



Viewing all articles
Browse latest Browse all 5308