I'm trying to have the pico write to serial and the pi read it.
I am powering VSYS and GND on the pico with 5V (also tried 3V3) and GND from the pi4. Going between GP0/GP1 (default) (also tried all other serial pins) on the pico and GPIO14/GPIO15 (default) on the pi4.
I've tried:
-new from box pi4b
-new from bag pico
-new pi4 image
-all of the above at the same time
-powering pi4 in 2 different ways (neither with low voltage warning)
I'm flashing the pico from my laptop with this script (from platformio on vscode), and my laptop receives the serial messages great:
Running this on the pi4:
I'm running bookworm 64 bit on the pi4. Serial port is enabled via raspi-config, serial login is disabled, and I've removed console=serial0 in /boot/firmware/cmdline.txt. (also added dtoverlay=disable-bt to config.txt even though it didn't seem to do anything in past testing). I've confirmed that none of the getty-serial services are using the uart. confirmed that the parity and stopbit defaults are the same for the two.
I'm really puzzled because I've been doing something very similar recently- serial comms between an arduino uno and the pi4. that stopped working earlier today and I managed to fry all my arduinos doing something else, so tried troubleshooting it with the pico and here we are.
Malformed data is sometimes received, especially while I'm reconnecting the UART jumpers, but never anything that looks even a little bit like what I'm sending.
I feel like the solution to this is going to be either the simplest, stupidest thing or the most obscure complicated thing, no inbetween, so any and all help is appreciated. I think it's pretty likely the issue is in the pi's software.
I am powering VSYS and GND on the pico with 5V (also tried 3V3) and GND from the pi4. Going between GP0/GP1 (default) (also tried all other serial pins) on the pico and GPIO14/GPIO15 (default) on the pi4.
I've tried:
-new from box pi4b
-new from bag pico
-new pi4 image
-all of the above at the same time
-powering pi4 in 2 different ways (neither with low voltage warning)
I'm flashing the pico from my laptop with this script (from platformio on vscode), and my laptop receives the serial messages great:
Code:
#include <Arduino.h>void setup() { Serial.begin(9600); pinMode(LED_BUILTIN, OUTPUT);}// the loop function runs over and over again forevervoid loop() { Serial.println("test"); // also tried Serial.print("test\n"); digitalWrite(LED_BUILTIN, HIGH); delay(100); digitalWrite(LED_BUILTIN, LOW); delay(900);}
Code:
import serialser = serial.Serial(port='/dev/serial0', baudrate=9600, timeout=1) # also tried /dev/ttyS0 (which /dev/serial0 is symlinked to)while True:if ser.in_waiting > 0: # also tried ser.inWaiting()print(received)line = ser.readline().decode('utf-8').rstrip()print(line)
I'm really puzzled because I've been doing something very similar recently- serial comms between an arduino uno and the pi4. that stopped working earlier today and I managed to fry all my arduinos doing something else, so tried troubleshooting it with the pico and here we are.
Malformed data is sometimes received, especially while I'm reconnecting the UART jumpers, but never anything that looks even a little bit like what I'm sending.
I feel like the solution to this is going to be either the simplest, stupidest thing or the most obscure complicated thing, no inbetween, so any and all help is appreciated. I think it's pretty likely the issue is in the pi's software.
Statistics: Posted by synapsomorphy — Thu Jun 20, 2024 10:47 pm