CAN Firmware Compilation
Pre-Flash Notes
Confirm Current Mode and Operation Path
- Important Note: If the toolboard is already in Klipper-CAN mode, you can directly flash it via command after compiling the firmware. The command will automatically reset it into
Katapultand complete the flash. - Factory State: The board comes pre-flashed with
Katapultfirmware in CAN mode at a baud rate of 1M. - Status Check (via LED): If the onboard LED is blinking (as shown below), it indicates the board is in
Katapultmode and ready for flashing.Loading... - Abnormal Mode: If the LED does not blink, the firmware is not
Katapult. You must reflash it by following the link below: Click here to flash Katapult firmware
Setting DIP Switches and Physical Connection
-
DIP Switch Settings: Regardless of the current state, first set the onboard DIP switch to CAN mode and turn on the
120Ωswitch (as shown below).Loading... -
Device Connection: Use a CAN cable to connect the toolboard to a UTOC or a mainboard already flashed with bridge firmware. Refer to the diagram below for wiring:
Loading... -
Critical Check (Termination Resistor): With the system completely powered off, use a multimeter to measure the resistance between the CAN_H and CAN_L pins.
Device Operation Instructions Toolboard Locate and install the jumper cap marked 120Ω.Mainboard If connecting to a mainboard, also install its 120Ωjumper cap.UTOC Module Includes a built-in resistor. How to Check:
- Keep the system completely powered off.
- Use a multimeter to measure the resistance between CAN-H and CAN-L on the toolboard's CAN port.
- Result Analysis:
- Approximately 60Ω: Normal, both termination resistors are correctly connected.
- Approximately 140Ω: The CAN-H and CAN-L wires may be reversed.
- Approximately 120Ω: The
120Ωresistor is not installed, or there is a break in the wiring. - Approximately 40Ω: There may be an extra resistor; please check the intermediate nodes.
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 useroot; switch to a regular user:su <username> - FLY Host System (FlyOS-FAST system)
Only supports login asrootuser (password:mellow)
Firmware Compilation Operation Guide
In the Klipper firmware configuration interface, only keyboard operations are supported; the mouse cannot be used.
| Key | Function |
|---|---|
| ↑ / ↓ | Move cursor up/down to select menu items |
| Enter / Space | Confirm selection, check options, or enter submenus |
| ESC | Return to the previous menu |
| Q | Exit the configuration interface |
| Y | If prompted when exiting, press Y to save the configuration |
Start Firmware Compilation
The following describes how to compile the firmware:
-
After connecting via SSH, enter the following command and press Enter:
cd ~/klipper && rm -rf ~/klipper/.config && rm -rf ~/klipper/out && make menuconfig -
Where
rm -rf ~/klipper/.config && rm -rf ~/klipper/outis to delete previous compilation data and firmware -
make menuconfigis for compiling the firmware, after execution you should see the following interfaceLoading... -
Select Enable extra low-level configuration options and press Enter
Loading... -
Enter the menu Micro-controller Architecture then select Raspberry Pi RP2040/RP235x and press Enter
Loading... -
Select Bootloader offset, select:16KiB bootloader
Loading... -
Select Communication interface, select:CAN bus
Loading... -
Select
(4) CAN RX gpio number, delete4and input1 -
Select
(5) CAN TX gpio number, delete5and input0Loading...
- Select GPIO pins to set at micro-controller startup, enter:
!gpio5Caution
Please input in English input mode
!gpio5Loading...- Please check against the image above to ensure it matches, then proceed to the next step
- Press the
Qkey, Save configuration will appear, then press theYkey
- The configuration should now be saved and you will return to the command line interface
- Enter the following command to start compiling, it will take some time
make -j4
- The following output indicates successful compilation
- Due to Klipper version issues, only the appearance of
out/klipper.binindicates successLinking out/klipper.elfCreating bin file out/klipper.bin
Search ID and Flash
Querying CANBus UUID
- It is recommended to perform ID query and firmware flashing operations in a non-printing state to avoid interfering with the printing process.
- The Katapult (CANBoot) firmware and Klipper firmware on the same mainboard/toolboard use the same CAN ID.
Please ensure the following conditions are met, otherwise the CAN ID may not be found:
- The host's CAN network is correctly configured
- The toolboard's CAN baud rate is exactly the same as the host's (inconsistent baud rates will prevent communication)
- Executing the
lsusbcommand shows the1d50:606fdevice (USB-CAN adapter)
Search Command (Choose based on system)
- Standard host search command
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
- FLY host search command
python3 ~/klipper/scripts/canbus_query.py can0
Search Result Explanation
Case 1: Mainboard/Toolboard with Klipper Firmware Flashed
- Display: Shows one CAN ID, with the prompt
Application: Klipper - Explanation: The device is already running Klipper firmware and can be used directly. This ID could belong to the mainboard or the toolboard.
- Differentiation Method: Disconnect the toolboard's CAN cable and search again. If the ID disappears, it belongs to the toolboard; if the ID remains, it belongs to the mainboard.
Case 2: Mainboard + Toolboard Ready for Flashing
- Display: Shows two CAN IDs
- Explanation: The mainboard runs Klipper firmware, and the toolboard runs CanBoot firmware, waiting to be flashed.
Case 3: UTOC + Toolboard Ready for Flashing
- Display: The UTOC itself does not display an ID, only the toolboard's ID is shown
- Explanation: The UTOC acts only as a bridge; ensure the toolboard is in CanBoot mode.
Case 4: No ID Displayed
- Display: No IDs are shown
- Possible Reasons:
- The CAN bus is occupied by Klipper
- Incorrect baud rate configuration on the host's CAN0 interface
- Physical wiring issues
- The device is not in CanBoot mode
- Ready for Flashing State: When the toolboard is in CanBoot mode, it will display
Application: CanBootand the firmware LED will blink. Firmware flashing can be performed at this time. - ID Occupancy Handling: If a device is already running Klipper firmware and the ID has been entered in the configuration file, the ID will not be shown (occupied by Klipper). To display it again, you need to comment out the ID in the configuration and perform a complete power cycle.
If you cannot query the UUID, please refer to: CAN Issue Troubleshooting Guide
Firmware Flashing
Flash Command
- Replace
241696050c56in the command below with the UUID you actually queried - Note: A space is required after the
-uparameter
python3 ~/klipper/lib/canboot/flash_can.py -u 241696050c56
Confirming Successful Flash
A CAN Flash Success prompt indicates successful flashing:
Firmware Update
Update Method
When a firmware update is required, simply:
- Recompile the firmware
- Ensure the device's CAN ID can be queried (or that Klipper is connected to the device)
- Execute the same flashing command
python3 ~/klipper/lib/canboot/flash_can.py -u <MCU ID>
Update Success Example
Confirm Firmware Startup
- If the firmware starts normally, the LED will light up.
Loading...