Skip to main content

RS232 Firmware Compilation

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 command below 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

  • Go into the menu Micro-controller Architecture and then select STMicroelectronics STM32 and press Enter

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

  • Select Bootloader offset, choose: NO bootloader

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

  • For Communication interface, choose: Serial (on USART1 PA10/PA9)

  • Select GPIO pins to set at micro-controller startup, input: !PA15 Please note ! is uppercase

  • Press Q key, you will see Save configuration, then press Y key

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

  • Input make -j4 to start compilation, it takes some time

  • The compilation is successful if the following output is shown

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

Enter Flash Mode

tip

Above is the RESET button, below is the BOOT button

  • There are two methods to enter DFU mode
  • Method one: With the motherboard completely powered off, hold the BOOT button while connecting the data transfer cable to the motherboard and the host machine
  • Method two: Connect the data transfer cable to the motherboard and the host machine, hold the BOOT button, press the RST button, release the RST button, and finally release the BOOT button

Confirm Flash Mode Entry

  • Ensure the host machine can connect to the internet normally.

  • Ensure the data cable connecting the lower-level machine to the host machine has data transmission capabilities.

  • After SSH connecting to the host machine, enter lsusb and press enter. One of the following three situations may occur:

    • Displays USB devices that have been recognized.
    • 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 (a system issue requires replacing the system).
  • If there is no reaction after entering lsusb, this is a system issue and cannot be resolved here; you need to replace a confirmed normal system.

  • If the information circled in the image below appears, you can proceed to the next step.

  • 0843:df11 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 not, check whether the data cable is properly connected or if the motherboard has entered DFU.

Note

Proceed to the next step only if you have 0843:df11.

Flash Firmware

  1. Install the flashing tool
  • No need to install the flashing tool for the FLY GUI.
  • If you need to install it, please note: The GUI needs to be connected to the internet to install properly.
  • If you have already installed it, no need to install again.
sudo apt update
sudo apt install dfu-util -y
  1. Execute the following command to check if the connection is successful.
lsusb
  • If there is no DFU device, please try to re-enter flashing mode.

  • Due to system version issues, other names may be displayed. If 0483:df11 is shown, it indicates that the flashing mode has been entered.

  1. Flash the firmware
  • Execute the code below to start flashing.
sudo dfu-util -a 0 -d 0483:df11 --dfuse-address 0x08000000 -D ~/klipper/out/klipper.bin
  1. If the following content is shown at the arrow as File downloaded successfully, the flashing is successful.
tip

After flashing is complete, you need to power off the motherboard completely.

  1. Flash Firmware

    sudo dfu-util -a 0 -d 0483:df11 --dfuse-address 0x08000000 -D ~/kliper/out/klipper.bin
  2. Flashing is successful if the following content is shown as indicated by the arrow in the image

tip

After flashing, the motherboard needs to be powered off completely.

Confirm Firmware Boot

  • If the firmware boots successfully, the LED will light up