MCU 'mcu' shutdown error

Basic Information:

Printer Model: Prusa i3MK3S+
MCU / Printerboard: Einsy
Host / SBC RPi5 with SD Card
klippy.log
klippy_mcu_shutdown.zip (2.0 MB)

Describe your issue:

This is the first time this has happened. I was in the middle of a 5-6 hours print job. When it was about 1.5 hours towarded the end, suddenly the following error showed up and the print job stopped.

Klipper reports: SHUTDOWN

MCU 'mcu' shutdown: Missed scheduling of next digital out event
This is generally indicative of an intermittend communication failure between micro-controller and host.
Once the underlying issue is corrected, use the "FIRMWARE_RESTART" command to reset the firmware, reload the config, and restart the host software.
Printer is shutdown"

What happened? Please let me know how to fix this and things to do to prevent this from happening again. Thank you

MCU 'mcu' config: ADC_MAX=1023 BUS_PINS_spi=PB3,PB2,PB1 BUS_PINS_twi=PD0,PD1 CLOCK_FREQ=16000000 MCU=atmega2560 PWM_MAX=255 RECEIVE_WINDOW=192 RESERVE_PINS_serial=PE0,PE1 SERIAL_BAUD=250000 STATS_SUMSQ_BASE=256
...
Stats 31791.5: gcodein=0  mcu: mcu_awake=0.210 mcu_task_avg=0.000371 mcu_task_stddev=0.000219 bytes_write=43257627 bytes_read=12789369 bytes_retransmit=537627 bytes_invalid=1611293 send_seq=1078132 receive_seq=1078132 retransmit_seq=1078126 srtt=0.004 rttvar=0.001 rto=0.025 ready_bytes=37 upcoming_bytes=6949 freq=15999509 sd_pos=5864377 einsy_board: temp=42.1 heater_bed: target=65 temp=65.2 pwm=0.862 raspberry_pi: temp=38.6 sysload=0.40 cputime=337.440 memavail=7505776 print_time=30387.788 buffer_time=2.846 print_stall=0 extruder: target=220 temp=220.0 pwm=0.331
Stats 31792.5: gcodein=0  mcu: mcu_awake=0.210 mcu_task_avg=0.000371 mcu_task_stddev=0.000219 bytes_write=43262212 bytes_read=12789976 bytes_retransmit=537627 bytes_invalid=1611470 send_seq=1078214 receive_seq=1078214 retransmit_seq=1078126 srtt=0.004 rttvar=0.001 rto=0.025 ready_bytes=36 upcoming_bytes=6988 freq=15999499 sd_pos=5866194 einsy_board: temp=42.0 heater_bed: target=65 temp=64.9 pwm=1.000 raspberry_pi: temp=38.6 sysload=0.40 cputime=337.456 memavail=7506176 print_time=30388.792 buffer_time=2.849 print_stall=0 extruder: target=220 temp=220.1 pwm=0.331
...
Sent 98 31792.868590 31792.866190 60: seq: 16, queue_step oid=9 interval=3876 count=18 add=-43, queue_step oid=12 interval=26104 count=2 add=1086, queue_step oid=12 interval=29992 count=1 add=0, queue_step oid=9 interval=3298 count=29 add=2, set_next_step_dir oid=12 dir=1, queue_step oid=12 interval=34166 count=2 add=31056, queue_step oid=14 interval=91605 count=3 add=-20661, queue_step oid=9 interval=3587 count=16 add=72
Sent 99 31792.882980 31792.880460 63: seq: 17, queue_step oid=12 interval=28659 count=2 add=-9972, queue_step oid=9 interval=4444 count=6 add=92, queue_step oid=12 interval=15349 count=2 add=-3054, queue_step oid=9 interval=4323 count=30 add=-39, queue_step oid=12 interval=11226 count=8 add=-244, queue_step oid=14 interval=39896 count=2 add=-2319, queue_step oid=12 interval=6812 count=20 add=-100, queue_step oid=9 interval=3203 count=21 add=14
...
Receive: 98 31792.790404 31792.785663 14: seq: 11, analog_in_state oid=16 next_clock=853655552 value=6641
Receive: 99 31792.892490 31792.882980 12: seq: 18, shutdown clock=850584085 static_string_id=Missed scheduling of next digital out event
...

Hmmmm…

Seems like the reason for the error is the communication issues.
But why do they exist? it is a good question.

Idk, what can be done here.
Unfortunately, I’m not familiar with this hardware.

Sometimes I could update various software without flashing the Einsy but one time it was required. I think I updated lots of software yesterday but Klipper did not ask me to re-flash the Einsy. Am I supposed to re-flash the Enisy whenever I update the software in Update Manager even I am not asked? This morning I could complete a very similar print job of about 6 hours without any issue.

From some old posts, people had this problem when they were using CANBUS or Octo but I don’t use them.

Well, most probably your problem is bytes_invalid and bytes_retransmit.
Neither depends on the firmware version, so if Klipper does not ask you directly, you could skip the update.
Like Klipper (Klippy/Host) waits for the new ADC value, ADC value gets missing, because of bytes_invalid, PWM updates do not trigger, and do not get sent to the MCU.
This is a probabilistic thing.

In your case, there is a USB2UART converter.
Unfortunately idk, why it can happen in this case.

Generally, with pure UART, there could be a missing GND pin.
But there is a USB that should provide it.
I doubt it is a corruption on the USB line.
But signal corruption on the UART side, on the board, also sounds strange.

I can only guess, something like, if there is a power issue on the RPI side.
Not like not enough power. But maybe a different phase/outlet for the printer and the RPI power brick.
If your RPI is powered from the 24V power supply with a buck converter, this sort of thing should be unlikely.
But this is only a rough guess, nothing more.

Hope that helps.

1 Like

My RPi5 is powered by the official 27W USB-C Power Supply from Raspberry.

Buy a Raspberry Pi 27W USB-C Power Supply – Raspberry Pi

The AC adapter is plugged into an IKEA KOPPLA 6 outlet power strip. The Prusa i3MK3S+ is also getting power from the power strip. I changed to RPi5 about a month ago when I switched to Klipper. Before that, I used RPi4 and stock Prusa firmware with no issue.

If this happens again, is there anything else that I can do besides getting klippy.log? I read an old post that somebody got this problem fixed by updating Klipper-related software. I already got the latest version of everything.

See Missed scheduling of next digital out event

These are GHIFAS, “General Hardware Issues From Arbitrary Sources.”
Unfortunately, they are very tedious to debug because Klipper can only tell you that an error occurred, not why. Often, the source of such errors is outside of Klipper’s control.