UART connection to RPi4?

Basic Information:

Printer Model: Custom based on Geeetech A30
MCU / Printerboard: MKS Robin Nano v3
klippy.log
klippy (2).log (394.6 KB)

Describe your issue:

I’m an idiot. I had my printer working running Klipper with an RPi2, but scored a couple RPi4s and figured I’d upgrade. With the RPi2, the Robin Nano was connected via UART only (no USB cable) and worked fine with the occasional undercurrent error (hence the switch). Now with the same config, I can’t get Klipper to recognized the mcu. (“mcu ‘mcu’: Unable to connect”). I’ve verified that the TX and RX pins I’m using are PB10 & PB11 and that’s what’s selected when running menuconfig. They are connected to GPIO 14 and 15 (tx to rx and rx to tx) along with ground. I’ve enabled serial connection in raspi-config and I’ve added serial: /dev/ttyAMA0 to the printer config.

I’m sure I’m missing a step somewhere but can’t seem to run it down. I’ve re-installed the Pi OS (Lite, 32-bit) several times, and compiled and flashed firmware more times that I can count. Any assistance would be greatly appreciated!

Please provide:

  1. the output of “raspi-gpio get”,
  2. the contents of config.txt (attach file here)
  3. the contents of cmdline.txt (attach file here)
pi@klippera30:~ $ raspi-gpio get
BANK0 (GPIO 0 to 27):
GPIO 0: level=1 fsel=0 func=INPUT pull=UP
GPIO 1: level=1 fsel=0 func=INPUT pull=UP
GPIO 2: level=1 fsel=0 func=INPUT pull=UP
GPIO 3: level=1 fsel=0 func=INPUT pull=UP
GPIO 4: level=1 fsel=0 func=INPUT pull=UP
GPIO 5: level=1 fsel=0 func=INPUT pull=UP
GPIO 6: level=1 fsel=0 func=INPUT pull=UP
GPIO 7: level=1 fsel=1 func=OUTPUT pull=UP
GPIO 8: level=1 fsel=1 func=OUTPUT pull=UP
GPIO 9: level=0 fsel=4 alt=0 func=SPI0_MISO pull=DOWN
GPIO 10: level=0 fsel=4 alt=0 func=SPI0_MOSI pull=DOWN
GPIO 11: level=0 fsel=4 alt=0 func=SPI0_SCLK pull=DOWN
GPIO 12: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 13: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 14: level=1 fsel=2 alt=5 func=TXD1 pull=NONE
GPIO 15: level=1 fsel=2 alt=5 func=RXD1 pull=UP
GPIO 16: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 17: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 18: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 19: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 20: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 21: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 22: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 23: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 24: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 25: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 26: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 27: level=0 fsel=0 func=INPUT pull=DOWN
BANK1 (GPIO 28 to 45):
GPIO 28: level=1 fsel=2 alt=5 func=RGMII_MDIO pull=UP
GPIO 29: level=0 fsel=2 alt=5 func=RGMII_MDC pull=DOWN
GPIO 30: level=0 fsel=7 alt=3 func=CTS0 pull=UP
GPIO 31: level=0 fsel=7 alt=3 func=RTS0 pull=NONE
GPIO 32: level=1 fsel=7 alt=3 func=TXD0 pull=NONE
GPIO 33: level=1 fsel=7 alt=3 func=RXD0 pull=UP
GPIO 34: level=1 fsel=7 alt=3 func=SD1_CLK pull=NONE
GPIO 35: level=1 fsel=7 alt=3 func=SD1_CMD pull=UP
GPIO 36: level=1 fsel=7 alt=3 func=SD1_DAT0 pull=UP
GPIO 37: level=1 fsel=7 alt=3 func=SD1_DAT1 pull=UP
GPIO 38: level=1 fsel=7 alt=3 func=SD1_DAT2 pull=UP
GPIO 39: level=1 fsel=7 alt=3 func=SD1_DAT3 pull=UP
GPIO 40: level=0 fsel=4 alt=0 func=PWM1_0 pull=NONE
GPIO 41: level=0 fsel=4 alt=0 func=PWM1_1 pull=NONE
GPIO 42: level=1 fsel=1 func=OUTPUT pull=UP
GPIO 43: level=1 fsel=0 func=INPUT pull=UP
GPIO 44: level=1 fsel=5 alt=1 func=SDA0 pull=UP
GPIO 45: level=1 fsel=5 alt=1 func=SCL0 pull=UP
BANK2 (GPIO 46 to 53):
GPIO 46: level=0 fsel=0 func=INPUT pull=UP
GPIO 47: level=0 fsel=0 func=INPUT pull=UP
GPIO 48: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 49: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 50: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 51: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 52: level=0 fsel=0 func=INPUT pull=DOWN
GPIO 53: level=0 fsel=0 func=INPUT pull=DOWN

CONFIG.TXT

 http://rpf.io/configtxt
#Some settings may impact device functionality. See link above for details

#uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

#uncomment the following to adjust overscan. Use positive numbers if console
#goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

#uncomment to force a console size. By default it will be display's size minus
#overscan.
#framebuffer_width=1280
#framebuffer_height=720

#uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

#uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

#uncomment to force a HDMI mode rather than DVI. This can make audio work in
#DMT (computer monitor) modes
#hdmi_drive=2

#uncomment to increase signal to HDMI, if you have interference, blanking, or
#no display
#config_hdmi_boost=4

#uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

#Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=spi=on

#Uncomment this to enable infrared communication.
#dtoverlay=gpio-ir,gpio_pin=17
#dtoverlay=gpio-ir-tx,gpio_pin=18

#Additional overlays and parameters are documented /boot/overlays/README

#Enable audio (loads snd_bcm2835)
dtparam=audio=on

#Automatically load overlays for detected cameras
camera_auto_detect=1

#Automatically load overlays for detected DSI displays
display_auto_detect=1

#Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2
dtoverlay=disable_bt
#Disable compensation for displays with overscan
disable_overscan=1

[cm4]
#Enable host mode on the 2711 built-in XHCI USB controller.
#This line should be removed if the legacy DWC2 controller is required
#(e.g. for USB device mode) or if USB support is not required.
otg_mode=1

[all]

[pi4]
#Run as fast as firmware / board allows
arm_boost=1

[all]
enable_uart=1

CMDLINE.TXT:
console=tty1 root=PARTUUID=88a6ccd4-02 rootfstype=ext4 fsck.repair=yes rootwait

I was able to make some progress. I switched the mcu ‘mcu’ serial from /dev/ttyAMA0 to /dev/ttyS0 and the mcu connection error shifted from mcu ‘mcu’ could not connect to mcu ‘rpi’ could not connect. I had the old rpi2 set as a secondary mcu for running the accelerometer tests. I’ve removed the references to the the mcu rpi and all the accelerometer stuff and it seems to be working. (I’m not home so I can’t actually see the printer to be sure).

sigh which part of “attach file here” was complicated?

For the mcu rpi part see RPi microcontroller - Klipper documentation

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.