V3.0.1 STM32F401 version

This commit is contained in:
Alan.Ma
2022-08-12 11:14:24 +08:00
parent 0cedacbfd4
commit 36cbce5e04
16 changed files with 271 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -0,0 +1,69 @@
# [切换到中文版](./README_zh_cn.md)
# How to use Klipper on SKR-mini-E3-V3.0.1
## NOTE:
* This motherboard comes with bootloader which allows firmware update through SD card.
## Build Firmware Image
1. Precompiled firmware(The source code version used is [Commits on Jul 30, 2022](https://github.com/Klipper3d/klipper/commit/a709ba43af8edaaa307775ed73cb49fac2b5e550))
* [firmware-USB.bin](./firmware-USB.bin) Use USB to communicate with raspberry pi. Connect the type-A USB of raspberry pi with the MicroUSB of motherboard directly to communicate normally.
* [firmware-USART2.bin](./firmware-USART2.bin) Use TFT port USART2 to communicate with raspberry pi. Connect the UART-TX of raspberry pi with the USART-RX2 of motherboard and connect the UART-RX of raspberry pi with the USART-TX2 of motherboard directly to communicate normally.
2. Build your own firmware<br/>
1. Refer to [klipper's official installation](https://www.klipper3d.org/Installation.html) to download klipper source code to raspberry pi.
2. `Building the micro-controller` with the configuration shown below. (If your klipper cannot select the following configuration, please update your klipper source code)
* [*] Enable extra low-level configuration options
* Micro-controller Architecture = `STMicroelectronics STM32`
* Processor model = `STM32F401`
* Bootloader offset = `16KiB bootloader (HID Bootloader)`
* Clock Reference = `8 MHz crystal`
* IF USE USB
* Communication interface = `USB (on PA11/PA12)`
* ElSE IF USE USART2
* Communication interface = `Serial (on USART2 PA3/PA2)`
* ELSE
* Communication interface = `The port you want`
<img src=Images/menuconfig.png width="800" /><br/>
3. Once the configuration is selected, press `q` to exit, and "Yes" when asked to save the configuration.
4. Run the command `make`
5. The `klipper.bin` file will be generated in the folder `home/pi/kliiper/out` when the `make` command completed. And you can use the windows computer under the same LAN as raspberry pi to copy `klipper.bin` from raspberry pi to the computer with `pscp` command in the CMD terminal. such as `pscp -C pi@192.168.0.101:/home/pi/klipper/out/klipper.bin c:\klipper.bin`(The terminal may prompt that `The server's host key is not cached` and ask `Store key in cache?((y/n)`, Please type `y` to store. And then it will ask for a password, please type the default password `raspberry` for raspberry pi)
## Firmware Installation
1. You can use the method in [Build Firmware Image 2.5](#build-firmware-image) or use a tool such as `cyberduck` or `winscp` to copy the `klipper.bin` file from your pi to your computer.
2. Renamed the `firmware-USB.bin`, `firmware-USART2.bin` or the `klipper.bin`(in folder `home/pi/kliiper/out` build by yourself) to `firmware.bin`<br/>
**Important:** If the file is not renamed, the bootloader will not be updated properly.
3. Copy the `firmware.bin` to the root directory of SD card (make sure SD card is in FAT32 format)
4. power off the SKR-mini-E3-V3.0.1
5. insert the microSD card
6. power on the SKR-mini-E3-V3.0.1
7. after a few seconds, the SKR-mini-E3-V3.0.1 should be flashed
8. you can confirm that the flash was successful, by running `ls /dev/serial/by-id`. if the flash was successful, this should now show a klipper device, similar to:
<img src=Images/stm32f401_id.png width="600" /><br/>
(note: this test is not appicable if the firmware was compiled for UART, rather than USB)
## Configure the printer parameters
### Basic configuration
1. Refer to [klipper's official installation](https://www.klipper3d.org/Installation.html) to `Configuring OctoPrint to use Klipper`
2. Refer to [klipper's official installation](https://www.klipper3d.org/Installation.html) to `Configuring Klipper`. And use the configuration file [SKR-mini-E3-V3.0.1-klipper.cfg](./SKR-mini-E3-V3.0.1-klipper.cfg) as the underlying `printer.cfg`, which includes all the correct pinout for Octopus
3. Refer to [klipper's official Config_Reference](https://www.klipper3d.org/Config_Reference.html) to configure the features you want.
4. If you use USB to communicate with raspberry pi, run the `ls /dev/serial/by-id/*` command in raspberry pi to get the correct ID number of the motherboard, and set the correct ID number in `printer.cfg`.
```
[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32f401xx_4D003C000B50345033313820-if00
```
5. If you use USART2 to communicate with raspberry pi, you need to modify the following files by inserting the SD card into the computer or by SSH command.
* Remove `console=serial0,115200` in `/boot/cmdline.txt`
* Add `dtoverlay=pi3-miniuart-bt` at the end of file `/boot/config.txt`
* Modify the configuration of `[mcu]` in `printer.cfg` to `serial: /dev/ttyAMA0` and enable `restart_method: command` by SSH
```
[mcu]
serial: /dev/ttyAMA0
restart_method: command
```
<img src=Images/cfg_uart.png/><br/>

View File

@@ -0,0 +1,68 @@
# [View English version](./README.md)
# 在 SKR-mini-E3-V3.0.1 主板上使用 Klipper
## 注意:
* 此主板出厂时自带了引导程序允许通过microSD卡更新固件(firmware.bin)。
## 编译固件
1. 预编译的固件(预编译的固件源码版本是 [Commits on Jul 30, 2022](https://github.com/Klipper3d/klipper/commit/a709ba43af8edaaa307775ed73cb49fac2b5e550))
* [firmware-USB.bin](./firmware-USB.bin) 使用 USB 与树莓派通信。直接通过数据线将树莓派的 USB-A 连接到主板的 MicroUSB 接口即可正常通信。
* [firmware-USART2.bin](./firmware-USART2.bin) 使用 TFT 端口的 USART2 与树莓派通信. 通过杜邦线将树莓派的 UART-TX 接到主板的 USART-RX2 ,将树莓派的 UART-RX 接到主板的 USART-TX2 ,并且将地线连接在一起即可正常通信。
2. 自行编译最新版本的固件<br/>
1. 参考 [klipper官方的安装说明](https://www.klipper3d.org/Installation.html) 下载klipper源码到树莓派
2. 使用下面的配置去编译固件 (如果您的klipper无法选择如下的配置请更新您的klipper源码)
* [*] Enable extra low-level configuration options
* Micro-controller Architecture = `STMicroelectronics STM32`
* Processor model = `STM32F401`
* Bootloader offset = `16KiB bootloader (HID Bootloader)`
* Clock Reference = `8 MHz crystal`
* 如果使用 USB 与树莓派通信
* Communication interface = `USB (on PA11/PA12)`
* 如果使用 USART2 与树莓派通信
* Communication interface = `Serial (on USART2 PA3/PA2)`
* 或者
* Communication interface = `你自己想使用的端口`
<img src=Images/menuconfig.png width="800" /><br/>
3. 配置选择完成后, 输入 `q` 退出配置界面,当询问是否保存配置是选择 "Yes" .
4. 输入 `make` 命令开始编译固件
5.`make` 命令执行完成后,会在树莓派的`home/pi/kliiper/out`的文件夹中生成我们所需要的`klipper.bin`固件。你可以在CMD命令行终端中通过`pscp`命令把`klipper.bin`固件复制到与树莓派在同一个局域网下的电脑上。例如 `pscp -C pi@192.168.0.101:/home/pi/klipper/out/klipper.bin c:\klipper.bin`(命令行会提示 `The server's host key is not cached` 并且询问 `Store key in cache?((y/n)`, 输入 `y` 保存 host key然后输入树莓派默认的密码`raspberry`)
## 更新固件
1. 你可以使用 [编译固件 2.5](#编译固件) 中的方法或者使用 `cyberduck``winscp` 工具软件从树莓派中将 `klipper.bin` 文件复制到电脑上
2. 将我们提供的`firmware-USB.bin`, `firmware-USART2.bin` 或者你自行编译的 `klipper.bin` 文件重命名为 `firmware.bin`<br/>
**提示:** 如果没有重命名为 `firmware.bin`,引导程序将不会识别并更新此文件
3. 复制 `firmware.bin` 到microSD卡的根目录中(确保SD卡的文件系统是FAT32格式)
4. 将主板断电
5. 插入microSD卡
6. 给主板通电
7. 仅需几秒钟,主板就会自动完成更新固件的步骤
8. 你可以输入 `ls /dev/serial/by-id` 查询主板的串口ID来确认固件是否烧录成功如果烧录成功了会返回一个klipper的设备ID如下图所示:
<img src=Images/stm32f401_id.png width="600" /><br/>
(注意: 此步骤仅适用于USB通信的工作方式如果使用USART通信则没有这种ID)
## 配置打印机的参数
### 基础配置
1. 参考 [klipper官方的安装说明](https://www.klipper3d.org/Installation.html) to `Configuring OctoPrint to use Klipper`
2. 参考 [klipper官方的安装说明](https://www.klipper3d.org/Installation.html) to `Configuring Klipper`. 并且使用我们提供的配置文件 [SKR-mini-E3-V3.0.1-klipper.cfg](./SKR-mini-E3-V3.0.1-klipper.cfg) 为基础去修改 `printer.cfg`, 此文件中包含了主板几乎所有的pinout
3. 参考 [klipper官方的配置说明Config_Reference](https://www.klipper3d.org/Config_Reference.html) 去配置你想要的特性和功能
4. 如果你想通过USB与树莓派通信运行 `ls /dev/serial/by-id/*` 命令去查询主板的设备ID号`printer.cfg` 设置查询到的实际设备ID号
```
[mcu]
serial: /dev/serial/by-id/usb-Klipper_stm32f401xx_4D003C000B50345033313820-if00
```
5. 如果你想通过USART2与树莓派通信, 你需要修改一下的文件(你可以通过SSH终端输入命令修改可以直接修改树莓派系统SD卡中的文件)
* 在 `/boot/cmdline.txt` 文件中删除 `console=serial0,115200`
* 在 `/boot/config.txt` 文件的末尾添加 `dtoverlay=pi3-miniuart-bt`
* 修改配置文件 `printer.cfg` 的 `[mcu]` 部分为 `serial: /dev/ttyAMA0` 并且添加 `restart_method: command`
```
[mcu]
serial: /dev/ttyAMA0
restart_method: command
```
<img src=Images/cfg_uart.png/><br/>

View File

@@ -0,0 +1,126 @@
# This file contains common pin mappings for the BIGTREETECH SKR mini
# E3 v3.0. To use this config, the firmware should be compiled for the
# STM32G0B1 with a "8KiB bootloader" and USB communication.
# The "make flash" command does not work on the SKR mini E3. Instead,
# after running "make", copy the generated "out/klipper.bin" file to a
# file named "firmware.bin" on an SD card and then restart the SKR
# mini E3 with that SD card.
# See docs/Config_Reference.md for a description of parameters.
[stepper_x]
step_pin: PC11
dir_pin: !PC12
enable_pin: !PC10
microsteps: 16
rotation_distance: 40
endstop_pin: ^PB5
position_endstop: 0
position_max: 235
homing_speed: 50
[tmc2209 stepper_x]
uart_pin: PC7
tx_pin: PC6
uart_address: 0
run_current: 0.580
stealthchop_threshold: 999999
[stepper_y]
step_pin: PB12
dir_pin: !PB10
enable_pin: !PB13
microsteps: 16
rotation_distance: 40
endstop_pin: ^PB6
position_endstop: 0
position_max: 235
homing_speed: 50
[tmc2209 stepper_y]
uart_pin: PC7
tx_pin: PC6
uart_address: 2
run_current: 0.580
stealthchop_threshold: 999999
[stepper_z]
step_pin: PB1
dir_pin: PB0
enable_pin: !PB2
microsteps: 16
rotation_distance: 8
endstop_pin: ^PB7
position_endstop: 0.0
position_max: 250
[tmc2209 stepper_z]
uart_pin: PC7
tx_pin: PC6
uart_address: 1
run_current: 0.580
stealthchop_threshold: 999999
[extruder]
step_pin: PC2
dir_pin: !PC1
enable_pin: !PC3
microsteps: 16
rotation_distance: 33.500
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PA15
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PC5
control: pid
pid_Kp: 21.527
pid_Ki: 1.063
pid_Kd: 108.982
min_temp: 0
max_temp: 250
[tmc2209 extruder]
uart_pin: PC7
tx_pin: PC6
uart_address: 3
run_current: 0.650
stealthchop_threshold: 999999
[heater_bed]
heater_pin: PB3
sensor_type: ATC Semitec 104GT-2
sensor_pin: PC4
control: pid
pid_Kp: 54.027
pid_Ki: 0.770
pid_Kd: 948.182
min_temp: 0
max_temp: 130
[heater_fan heatbreak_cooling_fan]
pin: PC8
[heater_fan controller_fan]
pin: PA8
[fan]
pin: PC9
[mcu]
serial: /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00
[printer]
kinematics: cartesian
max_velocity: 300
max_accel: 3000
max_z_velocity: 5
max_z_accel: 100
[board_pins]
aliases:
# EXP1 header
EXP1_1=PB15, EXP1_3=PA9, EXP1_5=PA10, EXP1_7=PD2, EXP1_9=<GND>,
EXP1_2=PB14, EXP1_4=<RST>, EXP1_6=PB4, EXP1_8=PC0, EXP1_10=<5V>
# See the sample-lcd.cfg file for definitions of common LCD displays.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,8 @@
# SKR-mini-E3 V3.0.1 Marlin firmware
Note: The filename must be renamed to "firmware.bin" before coping this file to the motherboard onboard TF card.
### Ender-3 Precompiled firmware
* [firmware-ender3.bin](./firmware-ender3.bin): The original factory firmware for Ender-3, cannot support BLTouch
Marlin source code in [here](https://github.com/bigtreetech/Marlin/tree/SKR-mini-E3-F401)

Binary file not shown.