Skip to content

Commit 888d957

Browse files
authored
machine: Add board support for BigTreeTech SKR Pico (#4842)
* machine: add support for BTT SKR Pico Adds support for the BigTreeTech SKR Pico 3D-printer mainboard. This board uses the RP2040. * Fix build tag * Add I2C defaults * Run UART test instead of blinky1 * Use NoPin for I2C and SPI on BTT SKR Pico * Cleanup comments * Don't use ADC pin names
1 parent f69c579 commit 888d957

File tree

3 files changed

+136
-0
lines changed

3 files changed

+136
-0
lines changed

GNUmakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,8 @@ endif
630630
@$(MD5SUM) test.hex
631631
$(TINYGO) build -size short -o test.hex -target=nrf52840-mdk examples/blinky1
632632
@$(MD5SUM) test.hex
633+
$(TINYGO) build -size short -o test.hex -target=btt-skr-pico examples/uart
634+
@$(MD5SUM) test.hex
633635
$(TINYGO) build -size short -o test.hex -target=pca10031 examples/blinky1
634636
@$(MD5SUM) test.hex
635637
$(TINYGO) build -size short -o test.hex -target=reelboard examples/blinky1

src/machine/board_btt_skr_pico.go

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
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 = GPIO10
15+
Y_DIR = GPIO5
16+
Z_DIR = GPIO28
17+
E_DIR = GPIO13
18+
)
19+
20+
// TMC stepper driver motor step
21+
const (
22+
X_STEP = GPIO11
23+
Y_STEP = GPIO6
24+
Z_STEP = GPIO19
25+
E_STEP = GPIO14
26+
)
27+
28+
// TMC stepper driver enable
29+
const (
30+
X_ENABLE = GPIO12
31+
Y_ENABLE = GPIO7
32+
Z_ENABLE = GPIO2
33+
E_ENABLE = GPIO15
34+
)
35+
36+
// TMC stepper driver UART
37+
const (
38+
TMC_UART_TX = UART1_TX_PIN
39+
TMC_UART_RX = UART1_RX_PIN
40+
)
41+
42+
// Endstops
43+
const (
44+
X_ENDSTOP = GPIO4
45+
Y_ENDSTOP = GPIO3
46+
Z_ENDSTOP = GPIO25
47+
E_ENDSTOP = GPIO16
48+
)
49+
50+
// Fan PWM
51+
const (
52+
FAN1_PWM = GPIO17
53+
FAN2_PWM = GPIO18
54+
FAN3_PWM = GPIO20
55+
)
56+
57+
// Heater PWM
58+
const (
59+
HEATER_BED_PWM = GPIO21
60+
HEATER_EXTRUDER_PWM = GPIO23
61+
)
62+
63+
// Thermistors
64+
const (
65+
THERM_BED = GPIO26 // Bed heater
66+
THERM_EXTRUDER = GPIO27 // Toolhead heater
67+
)
68+
69+
// Misc
70+
const (
71+
RGB = GPIO24 // Neopixel
72+
SERVO = GPIO29 // Servo
73+
PROBE = GPIO22 // Probe
74+
)
75+
76+
// Onboard crystal oscillator frequency, in MHz.
77+
const (
78+
xoscFreq = 12 // MHz
79+
)
80+
81+
// I2C. We don't have this available
82+
const (
83+
I2C0_SDA_PIN = NoPin
84+
I2C0_SCL_PIN = NoPin
85+
86+
I2C1_SDA_PIN = NoPin
87+
I2C1_SCL_PIN = NoPin
88+
)
89+
90+
// SPI. We don't have this available
91+
const (
92+
SPI0_SCK_PIN = NoPin
93+
SPI0_SDO_PIN = NoPin
94+
SPI0_SDI_PIN = NoPin
95+
SPI1_SCK_PIN = NoPin
96+
SPI1_SDO_PIN = NoPin
97+
SPI1_SDI_PIN = NoPin
98+
)
99+
100+
// USB CDC identifiers
101+
const (
102+
usb_STRING_PRODUCT = "SKR Pico"
103+
usb_STRING_MANUFACTURER = "BigTreeTech"
104+
)
105+
106+
var (
107+
usb_VID uint16 = 0x2e8a
108+
usb_PID uint16 = 0x0003
109+
)
110+
111+
// UART pins
112+
const (
113+
UART0_TX_PIN = GPIO0
114+
UART0_RX_PIN = GPIO1
115+
UART1_TX_PIN = GPIO8
116+
UART1_RX_PIN = GPIO9
117+
UART_TX_PIN = UART0_TX_PIN
118+
UART_RX_PIN = UART0_RX_PIN
119+
)
120+
121+
var DefaultUART = UART0

targets/btt-skr-pico.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"inherits": [
3+
"rp2040"
4+
],
5+
"build-tags": ["btt_skr_pico"],
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)