Skip to main content

USB Firmware Compilation

tip
  • The USB accelerometer comes with the Klipper firmware pre-flashed for USB connection.
  • Only the firmware needs to be updated.
  • A USB cable can be used to connect the computer and the USB accelerometer.

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 network normally.
  • Before compiling the firmware, use SSH to log in to the host machine via 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 make sure that the keyboard input method is in half-width mode, i.e., English mode.

:::

  1. The key (up arrow) and (down arrow) on the keyboard are used to move the cursor up and down to select menu items.
  2. The confirm key Enter or spacebar Space is used to check the menu or enter a sub-menu.
  3. The exit key ESC is used to return to the previous menu.
  4. The Q key is used to exit the Klipper firmware configuration page.
  5. When exiting the Klipper firmware configuration page and there is a prompt, 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
  • Among them, 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, choose: NO bootloader

  • Communication interface, choose: USBSERIAL

  • Press Q key, when Save configuration appears, press Y again.
  • Now the configuration should be saved and you should be back at the command line interface.
  • Enter make -j4 to start compiling, it takes some time.
  • If the following output is displayed, compilation is successful.
  Linking out/klipper.elf
Building out/lib/elf2uf2/elf2uf2
Creating uf2 file out/klipper.uf2

Search for Device

  • Please ensure that the host machine can connect to the network normally and ensure that the data cable connecting the lower-level machine to the host machine has data transmission function.
  • After SSH connecting to the host machine, input 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 is a system problem of the host machine, and we are unable to help. You need to replace a confirmed normal system or replace the host machine.
    • If there is a prompt saying that the lsusb command does not exist, you can execute the following command to install it:
      sudo apt-get install usbutils
  • 1d50:614e belongs to the device you will use this time. The suffix OpenMoko, Inc. stm32f407xx has certain reference value but is not used as a basis for judgment.
    • Some host machines may display incompletely or not at all due to system problems.
    • If the device can be displayed by entering the lsusb command, but without 1d50:614e, please try replacing the data cable and connecting the motherboard to another USB port on the host machine.
  • If you have executed the above steps before and successfully burned the Klipper firmware, and the motherboard is running normally, and you just want 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 one of the 1d50:614e devices before proceeding to the next step.

Burn Firmware

  • Use the following command to search for your motherboard ID, which should display the ID shown in the image below (note: the ID shown in the image is for reference only, and each motherboard has a different ID):
ls /dev/serial/by-id/*
Note

The reference ID /dev/serial/by-id/usb-Klipper_rp2040_12345-if00 in the image below is the motherboard ID.

  • To update the USB firmware, input the following command after compiling the latest firmware, replacing <your motherboard ID> with the ID queried in the previous step:
cd ~/klipper/ && make flash FLASH_DEVICE=<your motherboard ID>

Solution for flashing the wrong firmware

  • Press and hold the button to enter DFU mode, and the computer will recognize it as a new USB drive; drag the firmware into it.
  • Clean the firmware using WINDOWS and then re-flash the firmware.