Skip to main content

USB Firmware Compilation

Start Compilation

  • A host machine with the installed klipper service is required Connect via SSH over the network
  • Make sure the device is connected to the host machine
  • Note: Please use a regular host machine, such as a Raspberry Pi FLY board, etc. If it's a modified host machine (e.g., WiFi stick, Redmi, etc.), due to too many issues, we cannot provide technical support for these machines
warning
  • To switch from the ROOT user to a regular user, you can enter the command below
  • Do not use the ROOT user
  • For the fly user, you can directly enter: su fly. For non-fly users, please replace <your host machine username> with your host machine's username!
su <your host machine username>
tip
  • 请确保上位机可以正常联网
  • 固件编译前需要使用SSH通过网络登录上位机
  • 请不要使用串口工具登录上位机

Klipper固件编译和配置页面操作说明

tip

请确保键盘输入法为半角模式,即英文模式

  1. 键盘上键,下键,用于上下移动光标来选中菜单项
  2. 确认键Enter 或 空格键Space,用于勾选菜单或进入子菜单
  3. 退出键ESC,用于返回上一级菜单
  4. Q键,用于退出Klipper固件配置页面
  5. Y键,在退出Klipper固件配置页面时,如果有提示,则点击Y键保存配置文件
warning

如果配置页面选项比较少,请先勾选[ ] Enable extra low-level configuration options,用于显示部分隐藏选项

Below is the 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 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 then select Raspberry Pi RP2040 and press Enter

  • Select Bootloader offset, select: No bootloader

  • Communication interface, select: USBSERIAL

  • Press the Q key, when Save configuration appears, press the Y key again
  • Now the configuration should be saved and you should have exited to the command line interface
  • Enter make -j4 to start compiling, it will take some time
  • If the output is as follows, then the compilation was successful

    Linking out/klipper.elf
    Creating hex file out/klipper.bin

Search for Devices

  • Please ensure that the host machine can connect to the network normally, and ensure that the data cable connecting the sub-machine to the host machine has data transmission capabilities.
  • After SSH connecting to the host machine, enter lsusb and press Enter. If the information circled in the image below is displayed, you can proceed to the next step.
    • If there is no feedback information, this indicates a system problem with the host machine, and we are unable to assist. You need to replace it with a confirmed normal system or replace the host machine.
    • If the prompt says there is no lsusb command, you can execute the following command to install it:
      sudo apt-get install usbutils
  • 1d50:6177 belongs to the device you will be using this time. The suffix OpenMoko, Inc. stm32f407xx has some reference value but is not used as a basis for judgment.
    • Some host machines may display incomplete or no information due to system problems.
    • If entering the lsusb command displays the device but does not show 1d50:6177, please try replacing the data cable and attempt to connect the motherboard to another USB port on the host machine.
  • If you have executed the above steps previously and successfully burned the Klipper firmware, and the motherboard is running normally, but you just need to update the Klipper firmware, please directly refer to the Firmware Update section in the right-hand menu bar of this page.
Note

You must query the 1d50:6177 device before proceeding to the next step.

Flash Firmware

tip
  • When installing the firmware burning plugin, please ensure your host machine is connected to the internet.
  • If you have already installed it, there is no need to install it again.

Start Burning

Warning
  • For non-fly host machines, please execute the code below to install the dependencies for firmware burning! Otherwise, the firmware cannot be burned!
    cd && git clone https://github.com/Arksine/katapult.git
  • Use the command below to search for your device ID, which should appear as shown in the image below (Note: The ID shown in the image is for reference only; each motherboard has a different ID).

    ls /dev/serial/by-id/*
  • To burn the firmware, use the command below. Ensure that the firmware has been compiled, and replace <your motherboard ID> with the ID queried in the previous step.

    ~/klippy-env/bin/python ~/katapult/scripts/flashtool.py -d /dev/serial/by-id/<your motherboard ID>
  • Below is a reference:

  • After burning the firmware, refer to the following:

Firmware Update

  • Use the command below to search for your motherboard ID, which should appear as shown in the image below (Note: The ID shown in the image is for reference only; each motherboard has a different ID).

    ls /dev/serial/by-id/*
Note

In the image below, /dev/serial/by-id/usb-katapult_rp2040_E662549553642032-if00 is the motherboard's ID.

  • After compiling the latest firmware, enter the command below to update. Replace <your motherboard ID> with the ID queried in the previous step.

    cd ~/klipper/ && make flash FLASH_DEVICE=<your motherboard ID>

How to Fix Incorrect Firmware

  • Disconnect power from the motherboard, then reconnect it and quickly click the reset button twice on the motherboard.
  • Alternatively, clean the firmware using WINDOWS and then reinstall BL