Last active
May 7, 2026 13:58
-
-
Save benlye/aee202eb5e078dfc24a6c1d37bac5cce to your computer and use it in GitHub Desktop.
Q1 Pro Klipper Build and Flash
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -e | |
| cd ~/klipper | |
| MCU_CONFIG=~/q1-pro-mcu.config | |
| TOOLHEAD_CONFIG=~/q1-pro-toolhead.config | |
| # Compile the MCU firmware | |
| make clean KCONFIG_CONFIG=$MCU_CONFIG | |
| make menuconfig KCONFIG_CONFIG=$MCU_CONFIG | |
| make KCONFIG_CONFIG=$MCU_CONFIG | |
| # Get the version | |
| VERSION=$(grep "// version" ~/klipper/out/compile_time_request.c | grep -oP 'v[0-9]+\.[0-9]+\.[0-9]+.*') | |
| # Copy the firmware to the output folder | |
| mkdir -p ~/fw/$VERSION | |
| cp ~/klipper/out/klipper.bin ~/fw/$VERSION/qd_mcu.bin | |
| # Compile the toolhead firmware | |
| make clean KCONFIG_CONFIG=$TOOLHEAD_CONFIG | |
| make menuconfig KCONFIG_CONFIG=$TOOLHEAD_CONFIG | |
| make KCONFIG_CONFIG=$TOOLHEAD_CONFIG | |
| # Get the version | |
| VERSION=$(grep "// version" ~/klipper/out/compile_time_request.c | grep -oP 'v[0-9]+\.[0-9]+\.[0-9]+.*') | |
| # Copy the firmware to the output folder | |
| mkdir -p ~/fw/$VERSION | |
| cp ~/klipper/out/klipper.bin ~/fw/$VERSION/qd_toolhead.bin | |
| # Show the paths | |
| echo | |
| echo MCU firmware: ~/fw/$VERSION/qd_mcu.bin | |
| echo Toolhead firmware: ~/fw/$VERSION/qd_toolhead.bin | |
| echo | |
| # Stop Klipper | |
| sudo service klipper stop | |
| # Flash the MCU | |
| ~/klipper/scripts/flash-sdcard.sh -f ~/fw/$VERSION/qd_mcu.bin /dev/ttyS0 qidi-q1-pro | |
| # Flash the toolhead | |
| sudo python3 ~/katapult/scripts/flashtool.py -b 250000 -r -d /dev/ttyS2 | |
| sudo python3 ~/katapult/scripts/flashtool.py -b 250000 -d /dev/ttyS2 -f ~/fw/$VERSION/qd_toolhead.bin | |
| # Start Klipper | |
| sudo service klipper start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment