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 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, input: !gpio18
Caution
Please enter
!gpio18in English input modeLoading...
- 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
Flash Firmware
- Before flashing the firmware, connect the tool board to a UTOC or a mainboard with bridge firmware using an XT30 data cable. Refer to the wiring diagram below.
- Please check if the DIP switch is set to the correct position.
KF Interface Diagram
XT30 Interface Diagram
- Ensure that the resistance between CAN H and CAN L, measured with a multimeter while powered off, is around
60Ω. If it is120Ω, connect a120Ωjumper. If it is around40Ω, remove the jumper.Loading...
Querying CANBus UUID
- 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.
Please ensure the following conditions are met; otherwise, it may not be possible to search for CAN IDs:
- The host computer's CAN network is correctly configured
- The CAN baud rate of the toolboard is exactly the same as that of the host computer (communication will fail if rates differ)
- After executing the
lsusbcommand, the1d50:606fdevice (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.
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.
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.
Scenario 4: No ID Displayed
- Display Effect: No IDs are displayed
- Possible Reasons:
- CAN bus is occupied by Klipper
- Incorrect baud rate configuration for the host's CAN0
- Physical wiring issues
- Device is not in CanBoot mode
- Ready for Flashing State: When a toolboard is in CanBoot mode, it will show
Application: CanBootand 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.
If the UUID cannot be queried, please refer to: CAN Troubleshooting Guide
Firmware Flashing
Flash Command
- Replace
241696050c56in the command below with your queried UUID - Note: Ensure there is a space after the
-uparameter
-
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:
Firmware Update
Update Method
When updating the firmware, simply:
- Recompile the firmware
- Ensure the device's CAN ID can be queried (or Klipper is connected to the device)
- Execute the same flash command
-
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
Verify Firmware Startup
- If the firmware starts normally, the LED will light up.
Loading...