USB Firmware Compilation
SSH Connection to the Host Machine
- Before compiling the firmware, you need to
connect to the host machine SSH via WiFi.
- First, please: Use WiFi to Connect to Host SSH
- USB Firmware Flashing
- Manual USB Firmware Compilation
USB Firmware Flashing
- The FLYOS-FAST system has pre-compiled a USB firmware. Manual compilation is not required; you can flash it by executing the command below.
- Alternatively, you can choose
Manual USB Firmware Compilationto compile the firmware yourself.
- Connect to the host machine via SSH and enter the following command:
fly-flash -d auto -h -f /usr/lib/firmware/klipper/stm32f407-32k-usb.bin
Firmware Compilation Notes and Operation Guide
Important Notes
- Network Connection: Ensure the host machine (Raspberry Pi, etc.) is connected to the network.
- Access Method: You must log in to the host machine via SSH over the network. Using serial port tools is prohibited.
- User Permissions: Use the correct user account for operations based on the host machine's system type.
- Input Method: Ensure the keyboard input method is set to Half-width mode (English mode).
SSH Login and User Switching
SSH Login to Host Machine
Use an SSH tool (such as MobaXterm, PuTTY, etc.) to log in to the host machine over the network: View Detailed SSH Connection Tutorial
Switch User Based on System Type
- Standard Host Machine (Armbian)
- FLY Host Machine
Applicable Systems:
- Official Raspberry Pi OS
- Other systems with Klipper installed
User Permission Requirements:
- Do not use the
rootuser for any operations. - You must switch to a standard user for operations.
Switch Command:
-
Other systems (replace
<username>with your username)su <username>
Standard users typically have the necessary compilation permissions. Using the root user may cause permission issues.
Applicable Systems:
- FlyOS-FAST System
Login Information:
- Username:
root - Password:
mellow
The FAST system only has the root user.
Firmware Compilation Instructions
1. Keyboard Operation Guide
- In the Klipper firmware configuration page, you can only use the following shortcut keys for operation.
- You cannot use the mouse directly!
| Key | Function Description |
|---|---|
| ↑ ↓ Arrow Keys | Move the cursor up/down to select menu items. |
| Enter or Space | Confirm selection/check menu items or enter submenus. |
| ESC | Return to the previous menu level. |
| Q | Exit the Klipper firmware configuration page. |
| Y | Press Y to save the configuration if prompted when exiting. |
Show Hidden Options
If there are few options on the configuration page, first check:
[ ] Enable extra low-level configuration options
This option is used to display some hidden configuration options.
Start Firmware Compilation
The following describes how to compile the firmware:
-
After connecting via SSH, enter the following command and press Enter:
cd ~/klipper && rm -rf ~/klipper/.config && rm -rf ~/klipper/out && make menuconfig -
Among these,
rm -rf ~/klipper/.config && rm -rf ~/klipper/outdeletes previous compilation data and firmware. -
make menuconfigis for compiling the firmware. After execution, the following interface should appear:Loading... -
Select Enable extra low-level configuration options and press Enter.
Loading... -
Navigate to the Micro-controller Architecture menu, then select STMicroelectronics STM32 and press Enter.
Loading... -
Navigate to the Processor model menu, select STM32F407, and press Enter.
Loading... -
Select Bootloader offset, and choose: 32KiB bootloader.
Loading... -
For Communication interface, select: USB (on PA11/PA12).
Loading...
- Press the
Qkey. When Save configuration appears, press theYkey.Loading... - The configuration should now be saved, and you will exit back to the command line interface.
- Enter the following command to start compilation. This will take some time.
make -j4
- If the following content is output at the end, the compilation is successful.
- Due to Klipper version differences, as long as
out/klipper.binappears, it indicates success.Linking out/klipper.elf
Creating bin file out/klipper.bin
Firmware Flashing
Execute the following command to flash the firmware:
fly-flash -d auto -h -f /data/klipper/out/klipper.bin
Searching for USB ID
- Open your browser, enter the IP address of the host computer in the address bar. For example, if my host IP is
192.168.101.179, just type it and press Enter.
- Open the host's WEB interface. In the left sidebar configuration options, find:
Loading... |
Loading... |
- Click
printer.cfgto enter, then clickDEVICESin the top right corner.
Loading... | Loading... |
- Click
SERIAL, then refresh.
Loading... |
Loading... |
- Copy the ID. Click where the arrow points to copy.
Loading... |
Loading... |
Filling in the USB ID
Please note, the ID below cannot be used!!!!
serial: /dev/serial/by-id/usb-1a86_USB_Serial-if00-port0
- Close
DEVICESand fill in the ID.
- In the configuration file, change:
[mcu]
serial: /tmp/klipper_host_mcu
to:
[mcu host]
serial: /tmp/klipper_host_mcu
- Add:
[mcu]
serial: <Replace this with the ID you just queried>
Loading... |
Loading... |
- Fill the ID into the configuration.
- After filling in the ID, click
SAVE & RESTARTin the top right corner.
Loading... | Loading... |
- If Klipper prompts
ADC out of range, this is normal. Connect the heated bed and thermistor to the mainboard, configure the thermistor pins for the hotend and heated bed, then save and restart.
Note: All IDs appearing in this document are examples. The actual ID for each mainboard is different. Please fill in the ID you actually obtained.