CAN Firmware Compilation
Start Compilation
- A host computer with the
klipper
service installed is required. Connect SSH via network - And the device should be well connected to the host computer.
- Note: Please use a common host computer, such as Raspberry Pi, FLY Pi, etc. If it is a modified host computer (such as WiFi stick, Redmi, etc.), due to too many problems with this type of host computer, technical support cannot be provided for you.
- Please do not use the
ROOT
user.
- Command to switch users
su fly
- 请确保上位机可以正常联网
- 固件编译前需要使用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, andmake menuconfig
is to compile 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 STMicroelectronics STM32 and press Enter
-
Enter the menu Processor model, select STM32F072 and press Enter
-
Select Bootloader offset, select: 8KiB bootloader
-
Select Communication interface, select: CAN bus (on PB8/PB9)
-
Press the
Q
key, and when Save configuration appears, press theY
key again. -
You should now have saved the configuration and exited to the command line interface.
-
Enter
make -j4
to start the compilation process; it may take some time. -
The compilation is successful if the following output is displayed at the end:
Linking out/klipper.elf
Creating hex file out/klipper.bin
Search for Devices
- Please ensure that the host computer can connect to the network normally, and ensure that the data cable connecting the lower computer to the host computer has a data transmission function.
- After SSH connection to the host computer, enter
lsusb
and press Enter. If the information circled in the image below appears, you can proceed to the next step.- If there is no information feedback, this is a system problem of the host computer. We are powerless in this regard. You need to replace the system with a confirmed normal one or replace the host computer.
- If the
lsusb
command is not available, you can execute this command to install it:sudo apt-get install usbutils
1d50:6177
belongs to the device you will use this time. The suffixOpenMoko, Inc. stm32f407xx
has a certain reference value, but it is not used as a judgment basis.- Some host computers may not display the information completely or not display it at all due to system problems.
- If the device can be displayed when the
lsusb
command is entered, but1d50:6177
is not present, please try to replace the data cable and try to connect the motherboard to other USB ports of the host computer.
- If you have previously performed the above steps and successfully burned the Klipper firmware, and the motherboard is operating normally, but only need to update the Klipper firmware, please directly view the
Firmware Update
chapter in the menu bar on the right side of this page.
The next step can be performed only when 1d50:6177
is present.
Flash Firmware
- Before flashing the firmware, connect the tool board to the UTOC or a mainboard with bridging firmware using an XT30 data cable. Below is a reference wiring diagram.
- Ensure that the resistance between CAN H and CAN L is around
60Ω
in a power-off state. If it is120Ω
, you need to attach a120Ω
jumper. If it is around40Ω
, remove the jumper.
- 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>