# Error: Internal error in MCU 'mcu' stepcompress

**URL:** <https://klipper.discourse.group/t/error-internal-error-in-mcu-mcu-stepcompress/2702>\
**Category:** General Discussion\
**Created:** [April 25, 2022, 9:27pm UTC](https://klipper.discourse.group/t/error-internal-error-in-mcu-mcu-stepcompress/2702 "2022-04-25T21:27:51Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![bort](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@bort](https://klipper.discourse.group/u/bort)\
**Post date:** [April 25, 2022, 9:27pm UTC](https://klipper.discourse.group/t/error-internal-error-in-mcu-mcu-stepcompress/2702/1 "2022-04-25T21:27:51Z")

</div>

Attempted to print this model on my Geeetech A10 with BMG extruder and ran into this error. I am on a pretty recent version of Klipper `v0.10.0-319-g3e0c0e9c`. After doing lots of googling, reading the github issues and searching this forum - I have not found a solution. My suspicion is this might be a bug? I was able to print a calibration cube with no issues.

Have attached klippy.log, printer.cfg and gcode.  
[klippy.log](https://klipper.discourse.group/uploads/short-url/yhg3C8E3GTcwplrkfqlNDiWiAly.log) (2.6 MB)  
[printer.cfg](https://klipper.discourse.group/uploads/short-url/aPT959FvCfs7ywJaa5fOfsKKv0d.cfg) (6.1 KB)

---

<div class="post-metadata">

**Author:** ![bort](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@bort](https://klipper.discourse.group/u/bort)\
**Post date:** [April 25, 2022, 9:28pm UTC](https://klipper.discourse.group/t/error-internal-error-in-mcu-mcu-stepcompress/2702/2 "2022-04-25T21:28:31Z")

</div>

[GA10\_rpi-box.gcode.zip](https://klipper.discourse.group/uploads/short-url/uJpZIpav19KZQRr79UDonB0kVim.zip) (3.1 MB)  
Gcode for the box I was printing in separate reply as I wasnt allowed to attach more than 2 items.

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [April 26, 2022, 5:11am UTC](https://klipper.discourse.group/t/error-internal-error-in-mcu-mcu-stepcompress/2702/3 "2022-04-26T05:11:06Z")

</div>

Check your logs:

```auto
Timeout with MCU 'mcu' (eventtime=126700.692747)
Transition to shutdown state: Lost communication with MCU 'mcu'

```

is a few lines above the `error: Internal error in MCU 'mcu' stepcompress`. So this error is a symptom / consequence of the lost MCU connection.

No indication thou as to why the connection was lost. Can be multiply reasons, from bad cabling, EMI, hardware defects etc.

---

<div class="post-metadata">

**Author:** ![bort](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@bort](https://klipper.discourse.group/u/bort)\
**Post date:** [April 26, 2022, 6:21am UTC](https://klipper.discourse.group/t/error-internal-error-in-mcu-mcu-stepcompress/2702/4 "2022-04-26T06:21:09Z")

</div>

Is it possible to enable retries or something like that with Klipper comms to the MCU? As I have had some issues like this in the past.

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [April 26, 2022, 7:59am UTC](https://klipper.discourse.group/t/error-internal-error-in-mcu-mcu-stepcompress/2702/5 "2022-04-26T07:59:15Z")

</div>

Unfortunately this is not possible.  
Between the host and the MCU there are very strict timing requirements. Once the two get out of sync due to connection problems, Klipper will react with a fatal error.

---

<div class="post-metadata">

**Author:** ![bort](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@bort](https://klipper.discourse.group/u/bort)\
**Post date:** [April 26, 2022, 12:31pm UTC](https://klipper.discourse.group/t/error-internal-error-in-mcu-mcu-stepcompress/2702/7 "2022-04-26T12:31:48Z")

</div>

This might be incorrect, but looking through the Klipper MCU firmware and how it communicates with the host. It seems that it is essentially a RPC based system, with time syncing. When 4 clock sync messages build up in the queue, the connection is considered [timed out](https://github.com/Klipper3d/klipper/blob/master/klippy/clocksync.py#L145).

I am wondering if its possible to have enough [steps to compress](https://github.com/Klipper3d/klipper/blob/master/klippy/chelper/stepcompress.c#L750) that you would block the serial port from being able to process other commands such as clock sync above and cause the host program to think the connection has died?

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [April 26, 2022, 3:04pm UTC](https://klipper.discourse.group/t/error-internal-error-in-mcu-mcu-stepcompress/2702/8 "2022-04-26T15:04:05Z")

</div>

Generally the core of Klipper is the communication between host and MCU. From what I can tell this works very reliable, otherwise the support channels would be full of issues.  
Band-aiding ramshackle hardware with software is not the way to go, although typically taken as the first and foremost solution.

Any details on the precise inner workings would have to be answered by the core developers.

---

<div class="post-metadata">

**Author:** ![bort](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@bort](https://klipper.discourse.group/u/bort)\
**Post date:** [May 7, 2022, 9:50am UTC](https://klipper.discourse.group/t/error-internal-error-in-mcu-mcu-stepcompress/2702/9 "2022-05-07T09:50:34Z")

</div>

Not trying to be rude, but also “band aiding ramshackle hardware with software” makes no sense in the context of the potential issue i raised. If you don’t understand what I am talking about then just say so or dont reply.

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [May 7, 2022, 12:39pm UTC](https://klipper.discourse.group/t/error-internal-error-in-mcu-mcu-stepcompress/2702/10 "2022-05-07T12:39:06Z")

</div>

- Communication between host and MCU is key to Klipper
- On proper hardware it has proven to work on thousands of installations
- Interruptions, delays, errors lead to a hard fault

If you are experiencing such hard faults, it is most likely attributable to your hardware. Unfortunately most of time people with issues call for software improvements (which is working on countless instances) to cover up for some hardware issues.  
This in turn leads to more complex software that someone needs to write and maintain and even may introduce other issues that were not present before. Especially when working on very central functions of the system.

In any case you are happily invited to improve this system and propose a better solution in a pull request on Github.

---

<div class="post-metadata">

**Author:** ![EddyMI3D](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/eddymi3d/32/1981_2.png) [@EddyMI3D](https://klipper.discourse.group/u/EddyMI3D)\
**Post date:** [July 5, 2024, 6:56pm UTC](https://klipper.discourse.group/t/error-internal-error-in-mcu-mcu-stepcompress/2702/11 "2024-07-05T18:56:44Z")

</div>


