Skip to main content

USB Bridge CAN Firmware Flashing

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.
Note
  • Do not use the ROOT user
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 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
  • Among them, 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 STMicroelectronics STM32 and press Enter

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

  • Select Bootloader offset, choose: 128KiB bootloader

  • Select Clock Reference (8 MHz crystal), choose: 25 MHz crystal

  • Select Communication interface, choose: USB to CAN bus bridge (USB on PA11/PA12)

  • Press the Q key, then you will see Save configuration, press Y again at this time.

  • Now the configuration should be saved and you should be back to the command line interface.

  • Type make -j4 to start compilation, it may take some time.

  • The compilation is successful if the following output appears:

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

Confirm Enter Flash Mode

  • 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 for FLY 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.
Note

You can proceed to the next step only if there is a 1d50:606f.

Flash Firmware

tip

Use the Katapult firmware to conveniently update the firmware via SSH in the future, without needing to enter DFU mode for firmware burning.

Installation of Flashing Plugin

tip

Please note that installing the flashing plugin requires an internet-connected host machine. If it has already been installed, there is no need to install it again.

  • Install pip install pyserial

    pip install pyserial
  • If prompted with -bash: pip: command not found, execute the following:

    sudo apt-get install pip
  • If you encounter the error shown below, execute the following:

    pip install pyserial --break-system-packages

Start Flashing Firmware

  • Use the following command to search for your device's serial port address:

    ls /dev/serial/by-id/*
  • Below is a reference:

  • To flash the firmware, use the following command. Ensure that the firmware has been compiled and note that there should be no space after =.

  • Please ensure you are in the klipper directory to flash the firmware.

    make flash FLASH_DEVICE=
  • Below is a reference:

  • After flashing, refer to the following:

Method to Update Firmware

  • To update the USB firmware, input the following command after compiling the latest firmware. Note that there should be no space after =.

    make flash FLASH_DEVICE=
  • To update the USB bridge CAN firmware, input the following command after compiling the latest firmware to reset into Katapult.

  • Please note that this command can only be executed on the klipper firmware for the USB bridge CAN; executing it on other firmwares will result in errors.

    ~/klippy-env/bin/python3 ~/katapult/scripts/flashtool.py -i can0 -r -u <MCU ID>
  • After resetting into Katapult, execute the following command to update the firmware:

    make flash FLASH_DEVICE=<your device serial port address>

Solution for Incorrect Firmware Flashing

  • Power off the motherboard, then power it back on and quickly click the reset button twice.
  • Alternatively, use WINDOWS to clean the firmware and then reflash BL