Klipper shutdown due to MCU communication error

Basic Information:

Printer Model: Elegoo Neptune 3 ro
MCU / Printerboard: STM32
Host / SBC: Raspberry pi 3B

logs-20250526-213556.zip (1.2 MB)

The Klipper has been shutting down while printing. I have tried using different cables for the printer connection and still the error pops up. I have tried calibrating the hot end and the heated bed but still the error exists. But the shutdown does not always happen on the same layer, it happens on different time during the printer. Kindly help me to identify the issue.

Stats 11555.9: gcodein=0  mcu: mcu_awake=0.004 mcu_task_avg=0.000020 mcu_task_stddev=0.000017 bytes_write=6607580 bytes_read=1930563 bytes_retransmit=192 bytes_invalid=203 send_seq=128589 receive_seq=128589 retransmit_seq=113564 srtt=0.003 rttvar=0.000 rto=0.025 ready_bytes=0 upcoming_bytes=0 freq=84003040 sd_pos=1679663 heater_bed: target=90 temp=90.0 pwm=0.433 raspberry_pi: temp=39.7 mcu_temp: temp=52.2 sysload=0.80 cputime=274.791 memavail=492596 print_time=8162.793 buffer_time=2.266 print_stall=0 extruder: target=240 temp=240.0 pwm=0.614
Stats 11556.9: gcodein=0  mcu: mcu_awake=0.004 mcu_task_avg=0.000020 mcu_task_stddev=0.000017 bytes_write=6607764 bytes_read=1930563 bytes_retransmit=932 bytes_invalid=203 send_seq=128592 receive_seq=128589 retransmit_seq=128592 srtt=0.003 rttvar=0.000 rto=0.400 ready_bytes=144 upcoming_bytes=321 freq=84003040 sd_pos=1679789 heater_bed: target=90 temp=90.0 pwm=0.433 raspberry_pi: temp=39.2 mcu_temp: temp=52.2 sysload=0.80 cputime=274.804 memavail=492596 print_time=8163.575 buffer_time=2.047 print_stall=0 extruder: target=240 temp=240.0 pwm=0.614
Stats 11557.9: gcodein=0  mcu: mcu_awake=0.004 mcu_task_avg=0.000020 mcu_task_stddev=0.000017 bytes_write=6607764 bytes_read=1930563 bytes_retransmit=1302 bytes_invalid=203 send_seq=128592 receive_seq=128589 retransmit_seq=128592 srtt=0.003 rttvar=0.000 rto=1.600 ready_bytes=144 upcoming_bytes=1256 freq=84003040 sd_pos=1679976 heater_bed: target=90 temp=90.0 pwm=0.433 raspberry_pi: temp=39.7 mcu_temp: temp=52.2 sysload=0.80 cputime=274.823 memavail=492596 print_time=8164.607 buffer_time=2.079 print_stall=0 extruder: target=240 temp=240.0 pwm=0.614
Stats 11558.9: gcodein=0  mcu: mcu_awake=0.004 mcu_task_avg=0.000020 mcu_task_stddev=0.000017 bytes_write=6607764 bytes_read=1930563 bytes_retransmit=1302 bytes_invalid=203 send_seq=128592 receive_seq=128589 retransmit_seq=128592 srtt=0.003 rttvar=0.000 rto=1.600 ready_bytes=144 upcoming_bytes=2851 freq=84003040 sd_pos=1680289 heater_bed: target=90 temp=90.0 pwm=0.433 raspberry_pi: temp=39.7 mcu_temp: temp=52.2 sysload=0.80 cputime=274.849 memavail=492596 print_time=8165.955 buffer_time=2.425 print_stall=0 extruder: target=240 temp=240.0 pwm=0.614
Stats 11559.9: gcodein=0  mcu: mcu_awake=0.004 mcu_task_avg=0.000020 mcu_task_stddev=0.000017 bytes_write=6607764 bytes_read=1930563 bytes_retransmit=1487 bytes_invalid=203 send_seq=128592 receive_seq=128589 retransmit_seq=128592 srtt=0.003 rttvar=0.000 rto=3.200 ready_bytes=144 upcoming_bytes=4437 freq=84003040 sd_pos=1680604 heater_bed: target=90 temp=90.0 pwm=0.433 raspberry_pi: temp=38.6 mcu_temp: temp=52.2 sysload=0.90 cputime=274.875 memavail=492596 print_time=8166.835 buffer_time=2.306 print_stall=0 extruder: target=240 temp=240.0 pwm=0.614
Timeout with MCU 'mcu' (eventtime=11560.884588)
Transition to shutdown state: Lost communication with MCU 'mcu'
[mcu]
serial = /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
restart_method = command

Unfortunately, there is not a lot we can do here.
You can probably look at your Dmesg, maybe there are USB-related messages.

sudo dmesg
# or
journalctl -k

Or you can try to change the connection to direct UART if possible, maybe it would work better.

I can only guess that it is probably a grounding issue between SBC and MCU, but it is only a guess.

(Generally, USB devices have power provided by USB, and GND connected between USB devices)
(Generally, I would expect that RPI powered by step-down converter from printer PSU, would have less issues, in comparison to when there are 2 independent PSU, one for RPI and one for the printer)
(Ah, yes, this issue does not directly mean that one of PSU is bad or something, it can be an issue, but it does not mean that).

Hope that helps.