Flash Motherboard Firmware
Motherboard firmware needs to be updated to support the latest version of Klipper.
The process explains how to flash the Klipper Firmware and the Katapult Bootloader (useful for being able to update future Klipper firmwares later).
Prerequisites
- Combined Katapult Bootloader + Klipper Firmware for Motherboard: motherboard_fw.bin
- STM32 ST-LINK Utility ( Windows only): STM32_ST-LINK_Utility_v4.6.0.zip
- ST-LINK V2 Programmer: Amazon FR / Amazon US / Amazon CA
- 4 Dupont cables (usually supplied with the ST-LINK V2 Programmer)
Install STM32 ST-LINK Utility
Note
You can skip this step if you have already installed the utility.
-
Unzip
STM32_ST-LINK_Utility_v4.6.0.zip
file and runSTM32 ST-LINK Utility v4.6.0.exe
installer. -
Click on
Next
button: -
Click on
Yes
button: -
Click on
Next
button: -
Click on
Finish
button: -
A new window appears, click on
Next
button to install required drivers: -
Then, click on
Finish
button:
Connect ST-LINK V2 Programmer
-
Make sure your printer is turned off.
-
Connect motherboard JTAG pins to ST-LINK V2 Programmer:
Warning
Not all STM32 Programmers (especially clones) have the same pin positions.
Make sure to match the pins on the SMT32 Programmer with those on the motherboard. -
Connect the ST-LINK V2 Programmer to a USB port on your computer.
-
Start STM32 ST-LINK Utility and click on
Connect to target
button:If you have this message, it means that the Dupont cables are not connected to the right places, check your connections:
If you have this message, it means that the drivers for STM32 Programmer are not installed:
If you have this message, it means that the memory is protected against read out:
Click on
Target
→Option Bytes
and setRead Out Protection
parameter to Disabled, and then clickApply
button: -
If the connection is correct, you should get this:
Backup Motherboard Firmware
First of all, it's imperative to backup your motherboard's stock firmware in case you want to restore it.
-
When ST-LINK V2 Programmer is connected to motherboard, make sure the Size is set to
0x80000
-
Then, click on
File
→Save file as...
: -
And save the file on your computer with the name you want and the extension
.bin
. The file size should be 512 KB, which is a full dump.
Note
If needed, you can download a full dump of FLSUN S1 (not Pro) here: motherboard_fw_stock.bin
Flash Bootloader and Klipper Firmware
-
When ST-LINK V2 Programmer is connected to motherboard, click on
File
→Open file...
and selectmotherboard_fw.bin
firmware file: -
Then, click on
Program verify
button: -
Make sure this information are the same, click
Start
button and wait for the firmware to be written: -
If the firmware is written successfully, the following message will appear:
-
You can now disconnect from target by clicking on
Disconnect
button: -
You can now unplug the ST-LINK V2 Programmer from your computer and remove Dupont cables from motherboard.
-
Next, follow Insert microSD Card with FLSUN OS in Core Board section.
Note
If you want to go back to stock OS you need to reflash your backup firmware.
Update Klipper Firmware
Once the firmware is flashed, you will be able to update your motherboard MCU with a future Klipper Firmware.
Note
MCUs have limited write cycles (about 10K cycles for a STM32 chip). Updating the firmware with each Klipper release could shorten the life of your MCU!
When is it necessary to update Klipper firmware?
Every time Klipper mentions to update the MCU at startup, no more.
-
Connect to printer over SSH (see SSH Connection section).
-
In the SSH command prompt window, enter the following command to start Easy Installer:
-
Enter 3 for Extras menu → 2 for Update Motherboard MCU firmware → Enter to confirm your choice:
-
Klipper Firmware will be builded and flashed.
Extras
You can build your own Katapult Bootloader and Klipper Firmware and combine them into a ready-to-flash file.
-
Connect to printer over SSH (see SSH Connection section).
-
In the SSH command prompt window, enter the following commands (one at a time) to configure Katapult Bootloader:
-
Move on the menu with the ↑ and ↓ keys of your keyboard and validate the selected item with the Enter key and select these settings:
-
Then on your keyboard press the Q key then Y to save configuration.
-
Enter the following command to compile Katapult Bootloader:
-
When it's done, enter the following commands (one at a time) to configure Klipper Firmware:
-
Move on the menu with the ↑ and ↓ keys of your keyboard and validate the selected item with the Enter key and select these settings:
-
Then on your keyboard press the Q key then Y to save configuration.
-
Enter the following command to compile Klipper Firmware:
-
When it's done, enter the following command to combine Katapult Bootloader and Klipper Firmware into a ready-to-flash file:
-
Get the firmware named
motherboard_fw.bin
in/home/pi
directory (on the left panel of MobaXterm, right click on the file and selectDownload
).
If you like my work, don't hesitate to support me by paying me a 🍺 or a ☕. Thank you 🙂