Skip to content

Recovery via DFU

DFU (device firmware upgrade) is the STM32 chip’s built-in bootloader. It works even when the probe has no working firmware and no Katapult bootloader, which makes it the recovery route. Use it when:

  • the probe does not show up on USB or CAN after a failed or wrong flash,
  • the probe has never had Katapult installed, or
  • the update script and the Katapult methods are not an option.

For routine updates, use Updating Firmware instead; it does not require access to the probe.

This page flashes the combined firmware (Katapult_plus_…), which installs Katapult and the Cartographer firmware in one file, so that future updates can be done through Katapult. Pick the combined file that matches your hardware (V3 or V4), your protocol (USB, or CAN at 1M, 500K or 250K) and Full or Lite. Switching protocol is simply a matter of choosing a file for the other protocol.

You will need:

  • a USB cable wired for Cartographer, and
  • two pieces of conductive metal, such as tweezers or jumper wires, to bridge two pads.

If you will flash from your printer’s host, you also need the firmware repository on it:

You need the Cartographer firmware repository and Katapult on your Pi. Connect via SSH and run the following. It clones each repository if it is missing, or updates it if it is already there.

Terminal window
cd ~
if [ -d ~/cartographer_firmware/ ]; then
echo "Cartographer Firmware Exists - Updating Repository"
cd ~/cartographer_firmware/
git pull
else
git clone https://github.com/Cartographer3D/cartographer_firmware.git
fi
cd ~
if [ -d ~/katapult/ ]; then
echo "Katapult Exists - Updating Repository"
cd ~/katapult/
git pull
else
git clone https://github.com/Arksine/katapult.git
fi

Add both to moonraker.conf so they stay up to date. The Cartographer firmware entry is the same one used in Klipper Setup, so you may already have it.

[update_manager Cartographer Firmware]
type: git_repo
path: ~/cartographer_firmware
origin: https://github.com/Cartographer3D/cartographer_firmware.git
is_system_service: False
[update_manager katapult]
type: git_repo
path: ~/katapult
origin: https://github.com/Arksine/katapult.git
is_system_service: False

If you will flash from a Windows or Mac machine instead, download the file you need from the firmware repository and skip ahead to entering DFU mode.

Plug the USB cable into the probe and into the device you will flash from. That can be a Windows PC, a Mac, a Linux machine, or your printer’s host.

Use one conductive tool to bridge the two pads marked 1 (boot0). While holding that contact, briefly tap the pads marked 2 (reset) with the other tool.

Check that the probe is in DFU mode:

  • Linux: run lsusb. You should see a line like ID 0483:df11 STMicroelectronics STM Device in DFU Mode.
  • Windows: open Device Manager, expand Universal Serial Bus Devices, and look for STM32 BOOTLOADER.

Device Manager showing STM32 BOOTLOADER

If it is not there, repeat the step. It can take a couple of attempts to get the timing right.

SSH into the host and go to the combined-firmware folder for your probe.

Terminal window
cd ~/cartographer_firmware/firmware/v2-v3/combined-firmware/6.1.0

Confirm the probe is still in DFU mode with lsusb, then flash. Replace the file name with the one you need; all the combined files are flashed at 0x08000000.

Terminal window
sudo dfu-util -R -a 0 -s 0x08000000:leave -D Katapult_plus_CartographerV3_6.1.0_USB.bin -d 0483:df11

Available files in this folder: Katapult_plus_CartographerV3_6.1.0_USB.bin, …_USB_lite.bin, …_CAN_1M.bin, …_CAN_1M_lite.bin, …_CAN_500K.bin, …_CAN_500K_lite.bin, …_CAN_250K.bin, …_CAN_250K_lite.bin.

If dfu-util is not installed, install it with sudo apt install dfu-util.

Power-cycle the probe, or unplug and replug the USB cable. It should leave DFU mode and come up on USB or CAN, whichever firmware you chose.

  • A slowly flashing blue LED means the flash did not complete. Repeat from Step 1.
  • On USB, ls /dev/serial/by-id/ should now show usb-Cartographer_….
  • On CAN, ~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0 should list the probe (unless Klipper is already connected to it).

If you changed protocol, update the [mcu cartographer] section of printer.cfg to use serial: for USB or canbus_uuid: for CAN, as described in Klipper Setup.

You normally do not need this. If you want to flash the Katapult bootloader and the Cartographer firmware as two separate files via DFU, flash Katapult (from the katapult folder) at 0x08000000 first, then the …_8kib_offset.bin firmware file at 0x08002000. The 8kib in the name is that offset: it leaves the first 8 KiB for the bootloader. Flashing an _8kib_offset file at 0x08000000, or a combined file at 0x08002000, produces a probe that does not boot.