Skip to content

Commit af0ba67

Browse files
committed
machine: add support for BTT SKR Pico
Adds support for the BigTreeTech SKR Pico 3D-printer mainboard. This board uses the RP2040.
1 parent 632357f commit af0ba67

File tree

3 files changed

+115
-0
lines changed

3 files changed

+115
-0
lines changed

GNUmakefile

+2
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,8 @@ endif
628628
@$(MD5SUM) test.hex
629629
$(TINYGO) build -size short -o test.hex -target=nrf52840-mdk examples/blinky1
630630
@$(MD5SUM) test.hex
631+
$(TINYGO) build -size short -o test.hex -target=btt-skr-pico examples/blinky1
632+
@$(MD5SUM) test.hex
631633
$(TINYGO) build -size short -o test.hex -target=pca10031 examples/blinky1
632634
@$(MD5SUM) test.hex
633635
$(TINYGO) build -size short -o test.hex -target=reelboard examples/blinky1

src/machine/board_btt_skr_pico.go

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
//go:build btt_skr_pico
2+
3+
// This contains the pin mappings for the BigTreeTech SKR Pico.
4+
//
5+
// Purchase link: https://biqu.equipment/products/btt-skr-pico-v1-0
6+
// Board schematic: https://github.com/bigtreetech/SKR-Pico/blob/master/Hardware/BTT%20SKR%20Pico%20V1.0-SCH.pdf
7+
// Pin diagram: https://github.com/bigtreetech/SKR-Pico/blob/master/Hardware/BTT%20SKR%20Pico%20V1.0-PIN.pdf
8+
9+
package machine
10+
11+
// TMC stepper driver motor direction.
12+
// X/Y/Z/E refers to motors for X/Y/Z and the extruder.
13+
const (
14+
X_DIR Pin = GPIO10
15+
Y_DIR Pin = GPIO5
16+
Z_DIR Pin = ADC2
17+
E_DIR Pin = GPIO13
18+
)
19+
20+
// TMC stepper driver motor step
21+
const (
22+
X_STEP Pin = GPIO11
23+
Y_STEP Pin = GPIO6
24+
Z_STEP Pin = GPIO19
25+
E_STEP Pin = GPIO14
26+
)
27+
28+
// TMC stepper driver enable
29+
const (
30+
X_ENABLE Pin = GPIO12
31+
Y_ENABLE Pin = GPIO7
32+
Z_ENABLE Pin = GPIO2
33+
E_ENABLE Pin = GPIO15
34+
)
35+
36+
// TMC stepper driver UART
37+
const (
38+
TMC_UART_TX Pin = GPIO8
39+
TMC_UART_RX Pin = GPIO9
40+
)
41+
42+
// Endstops
43+
const (
44+
X_ENDSTOP Pin = GPIO4
45+
Y_ENDSTOP Pin = GPIO3
46+
Z_ENDSTOP Pin = GPIO25
47+
E_ENDSTOP Pin = GPIO16
48+
)
49+
50+
// Fan PWM
51+
const (
52+
FAN1_PWM Pin = GPIO17
53+
FAN2_PWM Pin = GPIO18
54+
FAN3_PWM Pin = GPIO20
55+
)
56+
57+
// Heater PWM
58+
const (
59+
HEATER_BED_PWM Pin = GPIO21
60+
HEATER_EXTRUDER_PWM Pin = GPIO23
61+
)
62+
63+
// Thermistors
64+
const (
65+
THERM_BED = ADC0 // Bed heater
66+
THERM_EXTRUDER Pin = ADC1 // Toolhead heater
67+
)
68+
69+
// Misc
70+
const (
71+
RGB Pin = GPIO24 // Neopixel
72+
SERVO_ADC3 Pin = ADC3 // Servo
73+
PROBE Pin = GPIO22 // Probe
74+
)
75+
76+
// Onboard crystal oscillator frequency, in MHz.
77+
const (
78+
xoscFreq = 12 // MHz
79+
)
80+
81+
// USB CDC identifiers
82+
const (
83+
usb_STRING_PRODUCT = "SKR Pico 2040"
84+
usb_STRING_MANUFACTURER = "BigTreeTech"
85+
)
86+
87+
var (
88+
usb_VID uint16 = 0x2e8a
89+
usb_PID uint16 = 0x0003
90+
)
91+
92+
// UART pins
93+
const (
94+
UART0_TX_PIN = GPIO0
95+
UART0_RX_PIN = GPIO1
96+
UART_TX_PIN = UART0_TX_PIN
97+
UART_RX_PIN = UART0_RX_PIN
98+
)
99+
100+
var DefaultUART = UART0

targets/btt-skr-pico.json

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"inherits": [
3+
"rp2040"
4+
],
5+
"build-tags": ["btt_rp2040"],
6+
"serial-port": ["2e8a:000A"],
7+
"ldflags": [
8+
"--defsym=__flash_size=16M"
9+
],
10+
"extra-files": [
11+
"targets/pico-boot-stage2.S"
12+
]
13+
}

0 commit comments

Comments
 (0)