Klipper is a 3d-Printer firmware. It combines the power of a general purpose computer with one or more micro-controllers.
Buildroot is a simple, efficient and easy-to-use tool to generate embedded Linux systems through cross-compilation.
buildroot-klipper3d is a Buildroot external tree that provides the necessary configuation files to build Klipper as a Buildroot package.
The package has been tested on a build for Raspberry Pi 4, which runs the Klipper3d host, connected to a printHAT 2 control board based on the STM32F401 microcontroller.
This repository is meant to be used defining the BR2_EXTERNAL variable, as described in the official manual
git clone https://github.com/cooked/buildroot-klipper3d.git
# get buildroot (skip if you have it already)
git clone https://github.com/buildroot/buildroot.git
cd buildroot
# use explicit Buildroot release (latest known to work for this project)
git fetch --all --tags
git checkout 2023.11.x
# configure the external folder (do nothing, exit without saving)
make BR2_EXTERNAL=../buildroot-klipper3d menuconfig
# load Buildroot config
make raspberrypi4_klipper3d_defconfig
# configure Klipper firmware
make klipper3d-menuconfig
# build everything
make
The Klipper microcontroller code still needs to be flashed manually from the Raspberry. The exact command to use depends on the target MCU; for an STM32 will look like this:
./stm32flash -w /opt/klipper3d/out/klipper.bin /dev/ttyAMA0
NOTE
Possibly, after flashing the MCU, the firmware shall be restarted:
echo FIRMWARE_RESTART > /dev/ttyAMA0
Read more about the Buildroot basics or this project development.