CAN Firmware Compilation
Start Compilation
- You need an upper computer with the
klipper
service installed Connect via SSH over the network - And make sure the device is connected to the upper computer
- Note: Please use a regular upper computer, such as a Raspberry Pi FLY board, etc. If you are using a modified upper computer, we cannot provide much assistance due to too many issues.
- Do not use the
ROOT
user
- 请确保上位机可以正常联网
- 固件编译前需要使用SSH通过网络登录上位机
- 请不要使用串口工具登录上位机
Klipper固件编译配置页面操作说明
请确保键盘输入法为半角模式,即英文模式
- 键盘上键
↑
,下键↓
,用于上下移动光标来选中菜单项 - 确认键
Enter
或 空格键Space
,用于勾选菜单或进入子菜单 - 退出键
ESC
,用于返回上一级菜单 Q
键,用于退出Klipper固件配置页面Y
键,在退出Klipper固件配置页面时,如果有提示,则点击Y
键保存配置文件
如果配置页面选项比较少,请先勾选[ ] Enable extra low-level configuration options
,用于显示部分隐藏选项
Below is an introduction on how to compile the firmware:
-
After connecting to 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/out
is to delete previous compilation data and firmware.make menuconfig
is for compiling the firmware. After execution, the following interface should appear: -
Select Enable extra low-level configuration options and press Enter
-
Enter the menu Micro-controller Architecture and then select Raspberry Pi RP2040 and press Enter
-
Select Bootloader offset, choose: 16KiB bootloader
-
Select Communication interface, choose: CAN bus
-
Select
(4) CAN RX gpio number
, delete 4 and input 1 -
Select
(5) CAN RX gpio number
, delete 5 and input 0
-
Select GPIO pins to set at micro-controller startup, input: !gpio5 Please note that ! is uppercase.
-
Press
Q
key, a Save configuration prompt appears, then pressY
key -
Now the configuration should be saved and you should be back to the command line interface
-
Input
make -j4
to start compiling, it will take some time -
The compilation is successful if the final output is as follows
Linking out/klipper.elf
Creating hex file out/klipper.bin
Search for Device
- Please ensure the host machine can connect to the network normally.
- Please ensure the data cable connecting the lower-level machine to the host machine has data transfer capabilities.
- After SSH connecting to the host machine, input
lsusb
and press enter. One of the following three situations may occur:- Displays recognized USB devices.
- Prompts that there is no
ls
command; you can execute this command to install it:sudo apt-get install usbutils
- No error message, no other information (system issues need to be replaced with a normal system).
- If there is no reaction after entering
lsusb
, this indicates a system issue beyond our control, and you need to replace it with a confirmed normal system. - If the information circled in the image below appears, you can proceed to the next step.
1d50:606f
belongs to the device you will use this time. Ignore the subsequent prompts as system issues may cause them to display incompletely or not at all.- If there are two
1d50:606f
, you need to determine why there are two and exclude one before restarting the system. - Two
1d50:606f
will affect subsequent burning and firmware connections, such as forFLY MINI PAD
, it is recommended to use only the on-board UTOC and not other CAN bridge devices. - If there is no
1d50:606f
, please check if the data cable is properly connected and if the firmware has been correctly flashed.
You can proceed to the next step only if there is a 1d50:606f
.
Burn Firmware
- Before burning the firmware, connect the tool board to UTOC or a mainboard flashed with bridge firmware using an XT30 cable. Below is a reference wiring diagram.
- Please ensure that the DIP switches are set correctly
- Ensure that the resistance between CAN H and CAN L is around
60Ω
when measured with a multimeter in a power-off state. If it is120Ω
, turn on the120Ω
DIP switch. If it is around40Ω
, turn off the DIP switch
- It is recommended not to perform ID finding and firmware flashing during the printing process.
- The CAN firmware IDs of the same motherboard or Katapult tool board and Klipper's CAN firmware are completely identical.
- Ensure that the host machine's CAN network has been configured.
- Use the command below to search for the CAN ID when
lsusb
shows1d50:606f
. - The tool board CAN rate must be consistent with the host machine, otherwise you cannot find the ID or burn the firmware.
-
Execute the following command to query the CANBus UUID:
~/klippy-env/bin/python ~/klipper/scripts/canbus_query.py can0
-
After inputting, you will encounter one of the following situations based on your machine. Below are references:
- First type: When the motherboard has bridge firmware installed, a single ID appears with a prompt
Application: Klipper
. - Second type: When the motherboard has bridge firmware installed and is paired with a tool board that needs firmware burning, two IDs appear.
- Third type: Using UTOC with a tool board that needs firmware burning.
- Note: UTOC does not display the ID.
- Fourth type: No ID prompt, generally due to Klipper occupancy, incorrect CAN0 rate on the host machine, or wiring anomalies.
- First type: When the motherboard has bridge firmware installed, a single ID appears with a prompt
-
Normally, if the tool board that needs firmware burning is in CANBOOT mode, it will prompt
Application: CanBoot
, and the corresponding firmware light will blink. At this point, you need to burn the Klipper firmware, otherwise, you cannot connect!!! -
Note: If the Klipper firmware has already had the ID filled in the configuration, the ID will not be displayed and will be occupied by Klipper. You need to mask the corresponding ID and power off the motherboard completely before restarting.
warning- If no UUID is found, please refer to the documentation below.
- CAN Issues Collection
-
-
Firmware Burning
-
Replace
241696050c56
in the command below with the UUID found during the search. Please note there is a space after-u
.python3 ~/klipper/lib/canboot/flash_can.py -u 241696050c56
-
As shown in the figure below, if
CAN Flash Success
appears, the burning is successful.
-
-
If you need to update the firmware, simply re-execute the burning command after compiling the firmware, but ensure that you can find the ID or Klipper is connected.
python3 ~/klipper/lib/canboot/flash_can.py -u <MCU ID>
Confirm Firmware Startup
- If the firmware starts up successfully, the LED will light up