Skip to main content

Klipper MCU Firmware – Reflashing (Ender 3 S1 Pro)

Overview

The Ender 3 S1 Pro runs an STM32F401 MCU. Klipper requires the MCU firmware and the host (klippy) to be built from the same source version. When the host is updated (e.g., after reprovisioning the Pi), the MCU firmware will lag behind and Klipper will report a deprecation warning.

Deprecation Warning Reference

Example warning:

MCU 'mcu' has deprecated code (it is missing feature 'STEPPER_STEP_BOTH_EDGE'). Recompiling and flashing is recommended (MCU version 'v0.12.0-85-gd785b396', host version 'v0.13.0-595-gb0e6ca45f-dirty').

This means the MCU firmware version is older than the host. The printer will still operate. Reflashing is recommended but not urgent unless you observe timing-related MCU shutdowns during fast moves.

What STEPPER_STEP_BOTH_EDGE means

Standard step mode fires the step pin on the rising edge only, with the falling edge serving as reset. Both-edge mode configures the TMC stepper driver (via UART) to count both rising and falling transitions as steps, halving the MCU's scheduling load per step. On the STM32F401 at normal Ender 3 S1 Pro speeds, the step-rate ceiling is high enough that missing this feature has no practical impact on print quality or reliability.

Before Reflashing

Confirm clean Klipper git state

cd ~/klipper
git status

Must show nothing to commit, working tree clean before proceeding. If dirty, see the Unattended Upgrades page for cleanup steps.

Pull latest Klipper source

cd ~/klipper
git pull

Build MCU Firmware

Run menuconfig

cd ~/klipper
make menuconfig

Set the following options exactly:

  • Micro-controller Architecture: STM32
  • Processor model: STM32F401
  • Bootloader offset: 64KiB bootloader
  • Communication interface: Serial (on USART1 PA10/PA9)

Exit and save.

Compile

make clean && make

Output file: ~/klipper/out/klipper.bin

Flash via SD Card

  1. Format an SD card as FAT32.
  2. Create a folder named STM32F4_UPDATE on the SD card.
  3. Copy ~/klipper/out/klipper.bin into the STM32F4_UPDATE folder. The filename must end in .bin and must not match the filename used in the previous flash.
  4. Power off the printer.
  5. Insert the SD card into the printer's card slot.
  6. Power on the printer. The flash process takes approximately 10–15 seconds. The screen will not display the normal menu during flashing.
  7. Power off the printer, remove the SD card, then power on normally.

Verify Flash Success

In Mainsail, check that the MCU connects without the deprecation warning. Confirm the MCU version string in the console or dashboard matches the current host version.

To see the MCU version reported at connection:

grep "mcu version" ~/printer_data/logs/klippy.log | tail -5

To check what MCU-side features differ between your flashed commit and current HEAD (run before reflashing to audit what changed):

cd ~/klipper
git log --oneline <mcu-commit-hash>..HEAD -- src/

Replace <mcu-commit-hash> with the short hash from the MCU version string (e.g., d785b396).