Unable to recompile firmware (dirty klipper version)

Basic Information:

Printer Model: Hevort
MCU / Printerboard: Manta MP8 v1.0
Host / SBC: CB1 v1
klippy.log
klippy.log (224.4 KB)

I had to change my BDsensor from FLY recently and when I got it back on my machine, after almost a month, I did an automatic update over mainsail. When it ended it turned out to return the above error.
Since then I`ve been tryint to recompile my firmware to make it work again, with no success.
Ive try thru DFU, serial and putting the sd card with firmware.bin in the sd bay of the printerboard. What I have seen is that the printer cannot convert firmware.bin to firmware.cur on the root of my host operational system. Ive try putting another card, and this conversion worked fine, so I guess it has to do with Armbian permissions. Im not sure what im missing. Why this happens once in a while? Will I have to reinstall the entire OS on my machine?
I have reinstalled and compile using make with the ./install_BDsensor.sh command, as the FlY documentation requires, and I get this when compiling:

I also have put it in dfu mode and do the flash, it looks very much like the above picture, no success resolving the problem.
Also have try to reinstall klipper

Nasty things can happen when things get dirty: The "dirty" Flag and the Team's Position

do you think it has to do with the BDsensor?

Try upgrading your dfu-util. Check if

sudo apt update
sudo apt upgrade

offers a new version, otherwise you might have to compile and update manually → Building dfu-util from source

How did you install Klipper and the other various utilities?

I’m asking because you’re running dfu-util version 0.9.

According to the release information, this is 9 years old: Index of /releases

You should have 0.11 (which is the latest). If you’re using KIAUH, then you should have 0.11.

Follow the commands suggested by @Sineos and see if it updates dfu-util but I’m still curious about how you set up Klipper.

I did with latest kiauh version, I think its 6 right? The BTT Manta MP8 manual says not to bother with dfu errors, so I did not… Even so, I tried to reinstall dfu-util and it returned the version 0.9
I will try building dfu-util from source

I just checked, the latest version of KIAUH is v6.0.0-beta.3, as per the startup panel:

As for dfu-util:

biqu@desk:~ $ dfu-util -V
dfu-util 0.11

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2021 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Can you precisely explain how you set up your CB1 and loaded the Klipper software? If possible, could you pull the current SD Card from the Manta M8P, put in a new one and start over, documenting each step.

I feel like the downlevel dfu-util level is a symptom of something else and that “something else” is the cause of your overall problems.

Just a long shot: Maybe the OP is using an ages-old, half-baked BTT Linux image on the CB1.

As an alternative and before messing with the Linux, which likely requires some Linux administration skills down the road: Get a recent Armbian Ubuntu server CB1 image (BIGTREETECH CB1 - Armbian) and flash it.

Just back up your config files beforehand and then reinstall using KIAUH. This will definitely solve the dfu-util issue and likely bring additional stability.

2 Likes

Thank you for the tip. It didnt work… I reinstalled the entire OS to the last release and got the exact same error. Maybe its because of the BDsensor.

I am a bit scared right now because in the past I have reinstalled the entire OS and installed everything fresh and it all worked. Now that didnt help.

Did you go to the Armbian version as proposed? Apparently, the initial issue of not being able to flash the MCU has been resolved.

Given the recent changes in Klipper in this area, my bet is on the BD sensor. Uninstall its source code modifications and flash Klipper again. If the error is gone, then you know for sure.

I did manage to install the latest distro from btt github for CB1 (Releases · bigtreetech/CB1 · GitHub).
I than flashed the firmware without installing the BDsensor aplications, runned upgrades on the Mainsail interface and flashed again after installing the BDsensor.
I ended up getting a funcional runnning klipper but with still dirty
Now im not sure if I should try to do a soft recovery or a hard recovery or do nothing

Check the klippy.log or attach here. It will tell you the reason for the dirty flag.

klippy.log (750.6 KB)

Are you using eddy-ng for nozzel tap?

nope, dont think so.

The log indicates:

  • Your local Klipper git working directory is clean and fully compliant to main line Klipper
  • The firmware installed on the printer board is dirty:
Loaded MCU 'mcu' 125 commands (v0.13.0-111-ged36041b6-dirty-20250513_152027-bigtreetech-cb1

Assumption: Most likely you have built and flashed the board when you still had some modifications in place. As per the explanation I shared above, the “dirty” status propagates into the firmware when built from a flagged version.

While it likely does not have any effect, you should be able to “heal” this by building and flashing from the clean working directory.

Thank you for the time!

I did try to flash again and try to “heal” the firmware, but when I do I get errors related to not recognizing the BDsensor commands. I get this klippy.log:
klippy (1).log (269.9 KB)

So I SSH back to the device and did the steps described on the BDsensor manual:

and than reflashed with :
sudo service klipper stop
make flash FLASH_DEVICE=/dev/serial/by-id/usb-1a86_USB2.0-Serial-if00-port0
sudo service klipper start

When I go back to the mainsail page I get this:

So, what is important is that its working, right? Thank you once again for your effort! You rock!

It is stil dirty, but what is important is that it works. I get the feeling I will be having to reflash every klipper update, I guess…

Usually not, as changes to the firmware are quite rare. I don’t have much experience with this sensor, but modifying the Klipper sources typically complicates matters, especially when updating.

It’s important to be aware that you’re not ‘installing’ the sensor; you’re running a script that modifies Klipper’s source code.