Kalico on the Sovol Zero - vvuk/printer-configs GitHub Wiki
A quick guide about how to install stock Kalico on the Sovol Zero and eddy-ng. With this combination, no functionality is lost.
Before starting, skip down to Troubleshooting and read the instructions on how to restore the stock firmware, and make sure you are comfortable doing those steps in case of failure.
⚠️⚠️⚠️⚠️ NOTE: Right now, this is not for beginners or those not very familiar with Klipper.
⚠️⚠️⚠️⚠️ You will have to figure out a lot of configuration yourself. You will need to troubleshoot installation, CANBUS, and other issues yourself. You may end up with a non-working printer. You will need to figure out your own configuration and macros. You may need to connect wires to your printer to re-flash with the STM32 tools.
⚠️⚠️⚠️⚠️ DO NOT DO THIS UNLESS YOU ARE COMFORTABLE TROUBLESHOOTING ISSUES YOURSELF. Once the issues have been worked out, a final set of instructions will be available that should be usable with few issues, but that time is not now.
Hardware overview
Mainboard
- MCU:
stm32h750
MCU - connected via (internal) USB to the integrated CB1; uses the Klipper USB-CAN bridge mode to act as a CAN bridge
- comes with Katapult pre-installed; upstream Katapult does not support the
h750
(trivial to add, but also no reason to replace Katapult at this time) - config:
STM32H750
- 128KiB bootloader offset
- Clock Reference:
25 MHz crystal
USB to CAN bus bridge (USB on PA11/PA12)
CAN bus on PB8/PB9
- GPIO pins to set at micro-controller startup:
!PE11,!PB0
- These are the aux and exhaust fans. If this isn't set, both of these will come on full blast at boot until Kalico takes control of the board
Toolboard
- MCU:
stm32f103
- connected via CAN
- comes with Katapult pre-installed
- config:
STM32F103
- 8KiB bootloader offset
- Clock Reference:
8 MHz crystal
CAN bus on PB8/PB9
Firmware Extras
: ensureeddy-ng
is enabled (after installing) to retain use of the eddy probe
Sovol Klipper Changes
There are a few changes Sovol has made that are not yet in upstream Kalico/Klipper/Katapult:
- Katapult on H750; 128kb bootloader offset option for H750
- More robust I2C error handling on stm32f103
Kalico Installation
For now, a specific branch of Kalico is required that includes the above changes. These instructions will move the stock Klipper installation out of the way and will set up Kalico in its place. You'll be able to swap back and forth (but you will need to flash both boards to do so).
Cloning and environment setup
- Start by ssh'ing to your printer.
- Stop the klipper service:
sudo service klipper stop
- Move Klipper and its environment out of the way:
mkdir orig-klipper
mv klipper klippy-env orig-klipper
- Clone Kalico from sovol-zero branch (note: this will clone into a directory named
klipper
, so that the services continue to work):
git clone -b sovol-zero https://github.com/vvuk/kalico klipper
- Create a new python environment and install the required packages:
python3 -m venv klippy-env
./klippy-env/bin/pip install -r klipper/scripts/klippy-requirements.txt
- Clone and install
eddy-ng
:
git clone https://github.com/vvuk/eddy-ng
cd eddy-ng
./install.sh
Building firmware
The branch includes toolboard.mcu
and main.mcu
configured for the Zero already. Before starting, figure out and save your stock toolboard and mainboard CANBUS UUIDs. Look in ~/printer_data/config/printer.cfg
for the two mcu
entries:
[mcu]
canbus_uuid: 0d1445047cdd
[mcu extruder_mcu]
canbus_uuid: 61755fe321ac
The first one is your mainboard ID, the second is your extruder. (Note: it's likely they will be identical to these numbers as Sovol seems to force these. These numbers will change once you flash new firmware, so be aware.)
Build and flash the toolboard firmware
- Configure the toolboard firmware:
cd ~/klipper
make KCONFIG_CONFIG=toolboard.mcu menuconfig
Make sure that the settings match the toolboard settings described at the top. Expand out Firmware Extras
and make sure eddy-ng
is present as an option and is enabled.
2. Build the toolboard firmware:
cd ~/klipper
make KCONFIG_CONFIG=toolboard.mcu clean
make KCONFIG_CONFIG=toolboard.mcu -j2
- Query the CAN bus to make sure you can see both devices:
~/klippy-env/bin/python3 ~/klipper/scripts/canbus_query.py
the output should look similar to the following and the two UUIDs should match the ones in the config file:
[can0] Found canbus_uuid=0d1445047cdd, Application: Klipper, Assigned: 04
[can0] Found canbus_uuid=61755fe321ac, Application: Klipper, Assigned: 05
Total 2 uuids found
- Flash the toolboard via CAN. Make sure you use your toolboard (extruder) UUID below.
cd ~/klipper
~/klippy-env/bin/python3 lib/canboot/flash_can.py -i can0 -u 61755fe321ac -f out/klipper.bin
This will reset the toolboard into the bootloader and will print some CAN devices IDs. One of them will be "CanBoot" or "Katapult". The command will overall fail, but run it again with that "CanBoot/Katapult" UUID:
~/klippy-env/bin/python3 lib/canboot/flash_can.py -i can0 -u THE_CANBOOT_UUID -f out/klipper.bin
If that still doesn't work (which is what happened to me), I had to flash immediately after a power cycle. But you have to disable the Klipper service from starting in order to do so:
sudo systemctl disable klipper sync /* power cycle your printer at this point, and ssh back in */ cd ~/klipper /* run the flash_can command above again */ /* once things are flashed, re-enable the klipper service: */ sudo systemctl enable klipper
If that still doesn't work, try again a few more times. Also run
~/klippy-env/bin/python3 lib/canboot/flash_can.py -i can0 -q
and see what shows up, and finally ask on Discord for help.
- Run
canbus_query.py
again. You should see a new device (that should have the nameKalico
, but also might be unclaimed). Remember the new UUID, i.e. the one that's not the same as the last time you ran query (the other one will still be the same mainboard UUID). This is your new toolboard UUID and you'll need it when configuring Kalico.
~/klippy-env/bin/python3 ~/klipper/scripts/canbus_query.py
Build and flash the mainboard firmware
The process is similar to the toolboard, but the flashing is more reliable because it happens over USB.
- Configure the mainboard firmware:
cd ~/klipper
make KCONFIG_CONFIG=main.mcu menuconfig
Make sure that the settings match the main settings described at the top. (You do not need eddy-ng
on the mainboard.)
2. Build the mainboard firmware:
cd ~/klipper
make KCONFIG_CONFIG=main.mcu clean
make KCONFIG_CONFIG=main.mcu -j2
- Flash the mainboard via CAN. Make sure you use your mainboard UUID below.
cd ~/klipper
~/klippy-env/bin/python3 lib/canboot/flash_can.py -i can0 -u 0d1445047cdd -f out/klipper.bin
For the mainboard the bootloader works over USB, so this command should (pretty much) always succeed. If it doesn't, check if the board has rebooted into the bootloader with
ls /dev/serial/by-id
and seeing if you have any "katapult" files listed there. (You'll probably also errors get errors about "No such device" and "Unable to bind socket to can0" if you run flash_can.) Then try flashing via USB directly:ls /dev/serial/by-id # take note of the file in there, it should have katapult or canboot in the name make KCONFIG_CONFIG=main.mcu FLASH_DEVICE=/dev/serial/by-id/THE_SERIAL_DEVICE_NAME flash
Starting Kalico
At this point you should be able to start Kalico, though it will error out due to configuration changes that need to be applied. It's good to check that you get to that point.
- Re-start the klipper service (or reboot):
sudo service klipper start
- Open the Mainsail UI, you should see configuration errors.
Updating your configuration
You can look at my working config here. The most relevant stuff is in printer.cfg
(e.g. eddy-ng config, fixed bed_mesh, delete z_offset_calibration), everything else is mostly copied from Sovol's config. I have some different TMC configurations in hw-steppers.cfg
, but Sovol's stock configuration should work. If you get errors about missing sense resistor values, Kalico requires this to be explicitly specified. The default in Klipper if not specified is 0.110, so if it's not specified somewhere add that as sense_resistor: 0.110
.
More detail TODO, but essentially:
- Update the
canbus_uuid
s for the mcu and extruder_mcu - Change the
probe_eddy_current
section to beprobe_eddy_ng
. Delete thez_offset
andvir_contact_speed
options. - Delete the
probe_eddy_current
section in the saved variables at the end ofprinter.cfg
. - Delete the
z_offset_calibration
section. - In
bed_mesh
, delete thescan_overshoot
option (Kalico does not yet have full rapid-scan bed mesh with all the options) - Optionally: for
tmc5160 stepper_x
andtmc5160 stepper_y
, addhome_current: 1.5
to take advantage of a kalico feature that uses a lower stepper current for homing. - Start the printer up
- Home XY
G28 X Y
- Move the toolhead to 75,75
- Run eddy-ng setup
PROBE_EDDY_NG_SETUP
SAVE_CONFIG
And you should be back in business. Note that you will also need to do a bunch of macro updates, including adding eddy-ng TAP
, deleting all the Z_OFFSET_CALIBRATION
junk. My configs are in this repo, but they are not fully tested.
Troubleshooting
Restoring back to Sovol stock Klipper
Sovol's latest update includes a copy of the extruder firmware, but not the mainboard firmware. A copy of the both the extruder and mainboard firmware (dumped from my printer) is available at (TODO, sorry, ask on Discord if you need these).
Note: for the toolboard, after flashing Kalico, the CANBUS UUID will change. However, when the toolboard is reset to the Katapult bootloader, the UUID will go back to the original one. (We don't replace Katapult in these instructions.) You'll need to run flash_can
twice.
You'll need both your toolboard and your mainboard UUID (new, if you've flashed before).
Restore the extruder toolboard firmware
- Run
canbus_query
to find UUIDs that are visible (note: these instructions use a sovol-providedflash_can.py
in~/printer_data/build
, which is newer and has features we need; after the latest firmware update, there is also a copy of the extruder firmware in here):
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
<examine IDs>
- Flash the original toolboard firmware; two-step process because the UUID changes in between:
~/klippy-env/bin/python ~/printer_data/build/flash_can.py -i can0 -u YOUR_EXTRUDER_TOOLBOARD_UUID -r
# this will reboot the toolhead into the bootloader. Run a query again and you should see a device as "CanBoot/Katapult":
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
# take that UUID and put it into the below command
~/klippy-env/bin/python ~/printer_data/build/flash_can.py -i can0 -u ORIGINAL_EXTRUDER_TOOLBOARD_UUID -f ~/printer_data/build/extruder_mcu_klipper.bin
# this should succeed
Restore the mainboard
You'll need a copy of the mainboard.bin
~/klippy-env/bin/python ~/printer_data/build/flash_can.py -i can0 -u MAINBOARD_UUID -f PATH_TO_YOUR/mainboard.bin
This should reboot into the (USB) bootloader and do the flash; no UUID dance should be required.
If things get bricked enough that you can't get into the bootloader
You'll need to use a ST-LINK and flash using the STM32 tools.
Finally restore the old environment and klipper
sudo service klipper stop
mkdir new-kalico
mv klipper klippy-env new-kalico
mv orig-klipper/* .
sudo service klipper start
Don't forget to restore your config as well.