Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
bigtreetech.Alan committed Mar 22, 2022
0 parents commit b842e4c
Show file tree
Hide file tree
Showing 2,730 changed files with 2,439,889 additions and 0 deletions.
820,055 changes: 820,055 additions & 0 deletions 3D/BIGTREETECH SKR 3.step

Large diffs are not rendered by default.

Binary file added BIGTREETECH SKR 3 user manual.pdf
Binary file not shown.
Binary file added BIGTREETECH SKR 3 用户手册.pdf
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Firmware/Klipper/Images/cfg_uart.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Firmware/Klipper/Images/menuconfig.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Firmware/Klipper/Images/stm32h743_id.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
85 changes: 85 additions & 0 deletions Firmware/Klipper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# [切换到中文版](./README_zh_cn.md)

# How to use Klipper on SKR-3

## 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 Mar 18, 2022](https://github.com/Klipper3d/klipper/commit/b4b19b8fc127051e12a9891990070b98bc6eac76))
* [firmware-USB.bin](./firmware-USB.bin) Use USB to communicate with raspberry pi. Directly connect the raspberry pi with the motherboard through the USB cable to communicate normally.
* [firmware-USART1.bin](./firmware-USART1.bin) Use TFT port USART1 to communicate with raspberry pi. Connect the UART-TX of raspberry pi with the USART-RX1 of motherboard and connect the UART-RX of raspberry pi with the USART-TX1 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 = `STM32H743`
* Bootloader offset = `(128KiB bootloader (SKR SE BX v2.0))`
* Clock Reference = `25 MHz crystal`
* IF USE USB
* Communication interface = `USB (on PA11/PA12)`
* ElSE IF USE USART1
* Communication interface = `(Serial (on USART1 PA10/PA9))`
* 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 [email protected]:/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-USART1.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 motherboard
5. insert the microSD card
6. power on the motherboard
7. after a few seconds, the motherboard 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/stm32h743_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-3-klipper.cfg](./generic-bigtreetech-skr-3.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_stm32h743xx_41003D001751303232383230-if00
```
5. If you use USART1 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/>

### BigTreeTech TFT TouchScreen emulated 12864 mode: Set the `display` in `printer.cfg` to the following parameters
```
[display]
lcd_type: emulated_st7920
spi_software_miso_pin: PA14 # status led, Virtual MISO
spi_software_mosi_pin: EXP1_3
spi_software_sclk_pin: EXP1_5
en_pin: EXP1_4
encoder_pins: ^EXP2_5, ^EXP2_3
click_pin: ^!EXP1_2
[output_pin beeper]
pin: EXP1_1
```
<img src=Images/cfg_tft_emulated_12864.png/><br/>
84 changes: 84 additions & 0 deletions Firmware/Klipper/README_zh_cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# [View English version](./README.md)

# 在 SKR-3 主板上使用 Klipper

## 注意:

* 此主板出厂时自带了引导程序,允许通过microSD卡更新固件(firmware.bin)。

## 编译固件
1. 预编译的固件(预编译的固件源码版本是 [Commits on Mar 18, 2022](https://github.com/Klipper3d/klipper/commit/b4b19b8fc127051e12a9891990070b98bc6eac76))
* [firmware-USB.bin](./firmware-USB.bin) 使用 USB 与树莓派通信。直接通过 USB 数据线将树莓派与主板连接起来即可正常通信。
* [firmware-USART1.bin](./firmware-USART1.bin) 使用 TFT 端口的 USART1 与树莓派通信. 通过杜邦线将树莓派的 UART-TX 接到主板的 USART-RX1 ,将树莓派的 UART-RX 接到主板的 USART-TX1 ,并且将地线连接在一起即可正常通信。

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 = `STM32H743`
* Bootloader offset = `(128KiB bootloader (SKR SE BX v2.0))`
* Clock Reference = `25 MHz crystal`
* 如果使用 USB 与树莓派通信
* Communication interface = `USB (on PA11/PA12)`
* 如果使用 USART1 与树莓派通信
* Communication interface = `(Serial (on USART1 PA10/PA9))`
* 或者
* 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 [email protected]:/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-USART1.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/stm32h743_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-3-klipper.cfg](./generic-bigtreetech-skr-3.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_stm32h743xx_41003D001751303232383230-if00
```
5. 如果你想通过USART1与树莓派通信, 你需要修改一下的文件(你可以通过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/>

### BigTreeTech TFT 触摸屏模拟12864模式(Marlin 模式): 将 `printer.cfg``display` 部分设置为如下所示
```
[display]
lcd_type: emulated_st7920
spi_software_miso_pin: PA14 # status led, Virtual MISO
spi_software_mosi_pin: EXP1_3
spi_software_sclk_pin: EXP1_5
en_pin: EXP1_4
encoder_pins: ^EXP2_5, ^EXP2_3
click_pin: ^!EXP1_2
[output_pin beeper]
pin: EXP1_1
```
<img src=Images/cfg_tft_emulated_12864.png/><br/>
Binary file added Firmware/Klipper/firmware-USART1.bin
Binary file not shown.
Binary file added Firmware/Klipper/firmware-USB.bin
Binary file not shown.
183 changes: 183 additions & 0 deletions Firmware/Klipper/generic-bigtreetech-skr-3.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
# This file contains common pin mappings for the BigTreeTech SKR 3.
# To use this config, the firmware should be compiled for the
# STM32H743 with a "128KiB bootloader".

# See docs/Config_Reference.md for a description of parameters.

[stepper_x]
step_pin: PD4
dir_pin: PD3
enable_pin: !PD6
microsteps: 16
rotation_distance: 40
endstop_pin: ^PC1
position_endstop: 0
position_max: 200
homing_speed: 50

[stepper_y]
step_pin: PA15
dir_pin: !PA8
enable_pin: !PD1
microsteps: 16
rotation_distance: 40
endstop_pin: ^PC3
position_endstop: 0
position_max: 200
homing_speed: 50

[stepper_z]
step_pin: PE2
dir_pin: PE3
enable_pin: !PE0
microsteps: 16
rotation_distance: 40
endstop_pin: ^PC0
position_endstop: 0.5
position_max: 200

[extruder]
step_pin: PD15
dir_pin: PD14
enable_pin: !PC7
microsteps: 16
rotation_distance: 33.500
nozzle_diameter: 0.400
filament_diameter: 1.750
heater_pin: PB3
sensor_type: EPCOS 100K B57560G104F
sensor_pin: PA2
control: pid
pid_Kp: 22.2
pid_Ki: 1.08
pid_Kd: 114
min_temp: 0
max_temp: 250

#[extruder1]
#step_pin: PD11
#dir_pin: PD10
#enable_pin: !PD13
#heater_pin: PB4
#sensor_pin: PA3
#...

[heater_bed]
heater_pin: PD7
sensor_type: Generic 3950
sensor_pin: PA1
control: watermark
min_temp: 0
max_temp: 130

[fan]
pin: PB7

#[heater_fan fan1]
#pin: PB6

#[heater_fan fan2]
#pin: PB5

[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

########################################
# EXP1 / EXP2 (display) pins
########################################

[board_pins]
aliases:
# EXP1 header
EXP1_1=PC5, EXP1_3=PB1, EXP1_5=PE9, EXP1_7=PE11, EXP1_9=<GND>,
EXP1_2=PB0, EXP1_4=PE8, EXP1_6=PE10, EXP1_8=PE12, EXP1_10=<5V>,
# EXP2 header
EXP2_1=PA6, EXP2_3=PE7, EXP2_5=PB2, EXP2_7=PC4, EXP2_9=<GND>,
EXP2_2=PA5, EXP2_4=PA4, EXP2_6=PA7, EXP2_8=<RST>, EXP2_10=<NC>

# See the sample-lcd.cfg file for definitions of common LCD displays.

########################################
# TMC2209 configuration
########################################

#[tmc2209 stepper_x]
#uart_pin: PD5
#run_current: 0.800
#diag_pin:

#[tmc2209 stepper_y]
#uart_pin: PD0
#run_current: 0.800
#diag_pin:

#[tmc2209 stepper_z]
#uart_pin: PE1
#run_current: 0.800
#diag_pin:

#[tmc2209 extruder]
#uart_pin: PC6
#run_current: 0.600
#diag_pin:

#[tmc2209 extruder1]
#uart_pin: PD12
#run_current: 0.600
#diag_pin:

########################################
# TMC2130 configuration
########################################

#[tmc2130 stepper_x]
#cs_pin: PD5
#spi_software_miso_pin: PE15
#spi_software_mosi_pin: PE13
#spi_software_sclk_pin: PE14
#run_current: 0.800
#stealthchop_threshold: 999999
#diag1_pin: PC1

#[tmc2130 stepper_y]
#cs_pin: PD0
#spi_software_miso_pin: PE15
#spi_software_mosi_pin: PE13
#spi_software_sclk_pin: PE14
#run_current: 0.800
#stealthchop_threshold: 999999
#diag1_pin: PC3

#[tmc2130 stepper_z]
#cs_pin: PE1
#spi_software_miso_pin: PE15
#spi_software_mosi_pin: PE13
#spi_software_sclk_pin: PE14
#run_current: 0.650
#stealthchop_threshold: 999999
#diag1_pin: PC0

#[tmc2130 extruder]
#cs_pin: PC6
#spi_software_miso_pin: PE15
#spi_software_mosi_pin: PE13
#spi_software_sclk_pin: PE14
#run_current: 0.800
#stealthchop_threshold: 999999
#diag1_pin: PC2

#[tmc2130 extruder1]
#cs_pin: PD12
#spi_software_miso_pin: PE15
#spi_software_mosi_pin: PE13
#spi_software_sclk_pin: PE14
#run_current: 0.800
#stealthchop_threshold: 999999
#diag1_pin: PA0
19 changes: 19 additions & 0 deletions Firmware/Marlin-bugfix-2.0.9.3.x/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# editorconfig.org
root = true

[{*.patch,syntax_test_*}]
trim_trailing_whitespace = false

[{*.c,*.cpp,*.h,*.ino}]
charset = utf-8

[{*.c,*.cpp,*.h,*.ino,Makefile}]
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
indent_style = space
indent_size = 2

[{*.py,*.conf,*.sublime-project}]
indent_style = tab
indent_size = 4
21 changes: 21 additions & 0 deletions Firmware/Marlin-bugfix-2.0.9.3.x/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

# Files with Unix line endings
*.c text eol=lf
*.cpp text eol=lf
*.h text eol=lf
*.ino text eol=lf
*.py text eol=lf
*.sh text eol=lf
*.scad text eol=lf

# Files with native line endings
# *.sln text

# Binary files
*.png binary
*.jpg binary
*.fon binary
*.bin binary
*.woff binary
Loading

0 comments on commit b842e4c

Please sign in to comment.