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
  • Please ensure that the host machine can connect to the internet normally.
  • Before compiling the firmware, you need to log in to the host machine via SSH through the network.
  • Do not use a serial port tool to log in to the host machine.

Klipper Firmware Compilation and Configuration Page Operation Instructions

tip

Please ensure that the keyboard input method is in half-width mode, i.e., English mode.

  1. The key on the keyboard is used for moving the cursor up, and the key is used for moving the cursor down to select menu items.
  2. The confirmation key Enter or the space key Space is used to check a menu item or enter a sub-menu.
  3. The exit key ESC is used to return to the previous menu level.
  4. The Q key is used to exit the Klipper firmware configuration page.
  5. When exiting the Klipper firmware configuration page and there are prompts, press the Y key to save the configuration file.
warning

If there are fewer options in the configuration page, please first check [ ] Enable extra low-level configuration options to display some hidden 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 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 then select STMicroelectronics STM32 and press Enter

  • Enter the menu Processor model, select STM32F407 and press Enter

  • Select Bootloader offset, select: 32KiB bootloader

  • Communication interface, select: USB (on PA11/PA12)

  • Press the Q key, a Save configuration prompt will appear, press Y again at this point

  • Now the configuration should be saved and you should have exited to the command line interface

  • Enter make -j4 to start compiling, it takes some time

  • If the following output appears, the compilation is successful

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

Confirm if in Flash Mode

  • 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 flashing plugin, please ensure that your host machine is connected to the internet.
  • If it has been installed, there is no need to install it again.

Start Flashing

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

    ls /dev/serial/by-id/*
  • To flash the firmware, use the following command, and make sure the firmware has been compiled. 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>

The fast system uses this command to flash, replace <your motherboard ID> with the ID queried in the previous step.

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

  • Reference after flashing is complete:

Firmware Update

  • Use the following command to search for your motherboard ID, and the ID shown in the image below should appear (note: the ID in the figure is for reference only, each motherboard has a different ID).

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

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

  • To update the USB firmware, you need to input the following command after compiling the latest firmware. Replace <your motherboard ID> with the ID queried in the previous step.

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

Solution for Wrong Firmware Flashing

  • Power off the motherboard, power it on again, and quickly double-click the reset button to re-enter the flashing mode.
  • Or re-flash the Katapult firmware using the window/host machine. Flash Katapult firmware