Skip to main content

CAN Firmware Compilation

Start Compilation

Brief Guide to Firmware Compilation

Notes

  • Network: Ensure the host (Raspberry Pi, etc.) is connected to the internet.
  • Login Method: Must log in via SSH over the network; serial port access is disabled.
  • Input Method: Keep the keyboard in English half-width mode.

SSH Login and User Switching

Use tools like MobaXterm, PuTTY, etc., to SSH into the host.

Switch User:

  • Standard System (Official Raspberry Pi system, etc.)
    Do not use root; switch to a regular user:
    su <username>
  • FLY Host System (FlyOS-FAST system)
    Only supports login as root user (password: mellow)

Firmware Compilation Operation Guide

In the Klipper firmware configuration interface, only keyboard operations are supported; the mouse cannot be used.

KeyFunction
↑ / ↓Move cursor up/down to select menu items
Enter / SpaceConfirm selection, check options, or enter submenus
ESCReturn to the previous menu
QExit the configuration interface
YIf prompted when exiting, press Y to save the configuration

Starting Firmware Compilation

The following describes how to compile the firmware:

  • After connecting via SSH, enter the command below and press Enter:

    cd ~/klipper && rm -rf ~/klipper/.config && rm -rf ~/klipper/out && make menuconfig
  • The rm -rf ~/klipper/.config && rm -rf ~/klipper/out part removes previous compilation data and firmware.

  • make menuconfig starts the firmware compilation configuration. After execution, the following interface should appear:

    Loading...
  • Select Enable extra low-level configuration options and press Enter:

    Loading...
  • Enter the menu Micro-controller Architecture and select Raspberry Pi RP2040/RP235x, then press Enter:

    Loading...
  • Select Bootloader offset, choose: 16KiB bootloader

    Loading...
  • Select Communication interface, choose: CAN bus

    Loading...
  • Select GPIO pins to set at microcontroller startup, input: gpio24
    Loading...
  • Press the Q key. When Save configuration appears, press the Y key.
    Loading...
  • The configuration should now be saved, and you should be returned to the command line interface.
  • Enter the following command to start compiling. This will take some time:
make -j4
Loading...
  • The compilation is successful if the output ends with the following content:
  • Due to Klipper version differences, the appearance of out/klipper.bin alone indicates success.
    Linking out/klipper.elf
    Creating bin file out/klipper.bin

Wiring

  • Before flashing the firmware, use an XT30 cable to connect the tool board to a UTOC or a motherboard with bridge firmware flashed. Below is a reference wiring diagram.
    Loading...
  • Ensure that the resistance between CAN H and CAN L is approximately 60Ω when measured with a multimeter while the power is off. If it is 120Ω, connect the 120Ω jumper. If it is around 40Ω, remove the jumper.
    Loading...
  • After connecting the tool board to a UTOC or motherboard with bridge firmware using an XT30 cable, the LED on the motherboard will start blinking.
Warning
  • If the LED does not blink, please reflash the Katapult firmware: Flash Katapult Firmware
  • If the LED does not blink, proceed to the next step after flashing the Katapult firmware.

Search ID and Flash

Querying CANBus UUID

Notes Before Operation
  • It is recommended to perform ID queries and firmware flashing in a non-printing state to avoid interrupting the printing process.
  • The Katapult (CANBoot) firmware and Klipper firmware on the same motherboard/toolboard use the same CAN ID.
Prerequisites

Please ensure the following conditions are met; otherwise, it may not be possible to search for CAN IDs:

  1. The host computer's CAN network is correctly configured
  2. The CAN baud rate of the toolboard is exactly the same as that of the host computer (communication will fail if rates differ)
  3. After executing the lsusb command, the 1d50:606f device (USB-CAN adapter) is visible

Search Command (Choose based on system)

  • Standard host machine search command
    ~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
  • FLY host machine search command
    python3 ~/klipper/scripts/canbus_query.py can0

Explanation of Search Results

Scenario 1: Motherboard/Toolboard with Klipper Firmware Flashed

  • Display Effect: Shows one CAN ID, with the hint Application: Klipper
  • Explanation: The device is running Klipper firmware and can be used directly. This ID could belong to the motherboard or the toolboard.
  • Differentiation Method: Disconnect the toolboard's CAN connection cable and re-search. If this ID disappears, it belongs to the toolboard; if the ID remains, it belongs to the motherboard.
Loading...

Scenario 2: Motherboard + Toolboard Ready for Flashing

  • Display Effect: Shows two CAN IDs
  • Explanation: The motherboard is running Klipper firmware, the toolboard is running CanBoot firmware and waiting to be flashed.
Loading...

Scenario 3: UTOC + Toolboard Ready for Flashing

  • Display Effect: UTOC itself does not display an ID, only the toolboard's ID is shown
  • Explanation: UTOC acts only as a bridge. Ensure the toolboard is in CanBoot mode.
Loading...

Scenario 4: No ID Displayed

  • Display Effect: No IDs are displayed
  • Possible Reasons:
    1. CAN bus is occupied by Klipper
    2. Incorrect baud rate configuration for the host's CAN0
    3. Physical wiring issues
    4. Device is not in CanBoot mode
Loading...

Important Notes
  • Ready for Flashing State: When a toolboard is in CanBoot mode, it will show Application: CanBoot and its status LED will flash, indicating firmware can be flashed.
  • ID Occupied Handling: If a device is running Klipper firmware and its ID has been configured in the configuration file, the ID will not be displayed (occupied by Klipper). To make it visible again, comment out the ID in the configuration and perform a complete power cycle.
Troubleshooting

If the UUID cannot be queried, please refer to: CAN Troubleshooting Guide

Firmware Flashing

Flash Command

  1. Replace 241696050c56 in the command below with your queried UUID
  2. Note: Ensure there is a space after the -u parameter
Version Information
  • FlyOS-FAST 1.3.8 and above or systems with Klipper updated after April 9, 2026, use the new command:

    python3 ~/klipper/lib/katapult/flashtool.py -u 241696050c56
  • Older systems (before FAST 1.3.8 or Klipper not updated before April 9, 2026), use the old command:

    python3 ~/klipper/lib/canboot/flash_can.py -u 241696050c56

Flash Success Confirmation

Seeing the CAN Flash Success message indicates a successful flash:

Loading...

Firmware Update

Update Method

When updating the firmware, simply:

  1. Recompile the firmware
  2. Ensure the device's CAN ID can be queried (or Klipper is connected to the device)
  3. Execute the same flash command
Version Information
  • FlyOS-FAST 1.3.8 and above or systems with Klipper updated after April 9, 2026:

    python3 ~/klipper/lib/katapult/flashtool.py -u <MCU ID>
  • Older systems (before FAST 1.3.8 or Klipper not updated before April 9, 2026):

    python3 ~/klipper/lib/canboot/flash_can.py -u <MCU ID>

Update Success Example

Loading...

Verify Firmware Startup

  • If the firmware starts normally, the LED will light up.
    Loading...
Loading...