Skip to content

Commit 2bc711c

Browse files
authoredFeb 8, 2023
✨ BigTreeTech Manta M4P, M5P, M8P V1.0 / 1.1, E3 EZ (MarlinFirmware#25001)
1 parent 444259d commit 2bc711c

21 files changed

+3061
-159
lines changed
 

‎Marlin/src/core/boards.h

+160-150
Large diffs are not rendered by default.

‎Marlin/src/pins/pins.h

+10
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,16 @@
545545
#include "stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h" // STM32F1 env:STM32F103RC_btt env:STM32F103RC_btt_USB env:STM32F103RE_btt env:STM32F103RE_btt_USB env:STM32F103RC_btt_maple env:STM32F103RC_btt_USB_maple env:STM32F103RE_btt_maple env:STM32F103RE_btt_USB_maple
546546
#elif MB(BTT_SKR_MINI_E3_V3_0)
547547
#include "stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h" // STM32G0 env:STM32G0B1RE_btt env:STM32G0B1RE_btt_xfer
548+
#elif MB(BTT_MANTA_M4P_V1_0)
549+
#include "stm32g0/pins_BTT_MANTA_M4P_V1_0.h" // STM32G0 env:STM32G0B1RE_btt env:STM32G0B1RE_btt_xfer
550+
#elif MB(BTT_MANTA_M5P_V1_0)
551+
#include "stm32g0/pins_BTT_MANTA_M5P_V1_0.h" // STM32G0 env:STM32G0B1RE_btt env:STM32G0B1RE_btt_xfer
552+
#elif MB(BTT_MANTA_E3_EZ_V1_0)
553+
#include "stm32g0/pins_BTT_MANTA_E3_EZ_V1_0.h" // STM32G0 env:STM32G0B1RE_btt env:STM32G0B1RE_btt_xfer
554+
#elif MB(BTT_MANTA_M8P_V1_0)
555+
#include "stm32g0/pins_BTT_MANTA_M8P_V1_0.h" // STM32G0 env:STM32G0B1VE_btt env:STM32G0B1VE_btt_xfer
556+
#elif MB(BTT_MANTA_M8P_V1_1)
557+
#include "stm32g0/pins_BTT_MANTA_M8P_V1_1.h" // STM32G0 env:STM32G0B1VE_btt env:STM32G0B1VE_btt_xfer
548558
#elif MB(BTT_SKR_MINI_E3_V3_0_1)
549559
#include "stm32f4/pins_BTT_SKR_MINI_E3_V3_0_1.h"// STM32F4 env:STM32F401RC_btt
550560
#elif MB(BTT_SKR_MINI_MZ_V1_0)
+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4+
*
5+
* Based on Sprinter and grbl.
6+
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
*
21+
*/
22+
#pragma once
23+
24+
#if NOT_TARGET(STM32G0xx) || NOT_TARGET(STM32G0B1xx)
25+
#error "Oops! Select an STM32G0 board in 'Tools > Board.'"
26+
#endif

‎Marlin/src/pins/stm32g0/pins_BTT_EBB42_V1_1.h

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*/
2222
#pragma once
2323

24+
#include "env_validate.h"
25+
2426
/** CAUTION **
2527
* This board definition is to facilitate support for a Filament Extrusion
2628
* devices, used to convert waste plastic into 3D printable filament.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,340 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4+
*
5+
* Based on Sprinter and grbl.
6+
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
*
21+
*/
22+
#pragma once
23+
24+
#include "env_validate.h"
25+
26+
#ifndef BOARD_INFO_NAME
27+
#define BOARD_INFO_NAME "BTT Manta E3 EZ V1.0"
28+
#endif
29+
30+
#define USES_DIAG_JUMPERS
31+
32+
// Ignore temp readings during development.
33+
//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
34+
35+
//
36+
// EEPROM
37+
//
38+
#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
39+
#undef NO_EEPROM_SELECTED
40+
#ifndef FLASH_EEPROM_EMULATION
41+
#define FLASH_EEPROM_EMULATION
42+
#endif
43+
#define EEPROM_PAGE_SIZE (0x800UL) // 2K
44+
#define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
45+
#define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE
46+
#endif
47+
48+
//
49+
// Servos
50+
//
51+
#define SERVO0_PIN PA7 // BLTouch
52+
53+
//
54+
// Probe enable
55+
//
56+
#if ENABLED(PROBE_ENABLE_DISABLE)
57+
#ifndef PROBE_ENABLE_PIN
58+
#define PROBE_ENABLE_PIN SERVO0_PIN
59+
#endif
60+
#endif
61+
62+
//
63+
// Trinamic StallGuard pins
64+
//
65+
#define X_DIAG_PIN PC4 // X-STOP
66+
#define Y_DIAG_PIN PB0 // Y-STOP
67+
#define Z_DIAG_PIN PC6 // Z-STOP
68+
#define E0_DIAG_PIN PC5 // E0-DET
69+
#define E1_DIAG_PIN PB1 // E1-DET
70+
71+
//
72+
// Limit Switches
73+
//
74+
#define X_STOP_PIN X_DIAG_PIN // X-STOP
75+
#define Y_STOP_PIN Y_DIAG_PIN // Y-STOP
76+
#define Z_STOP_PIN Z_DIAG_PIN // Z-STOP
77+
78+
//
79+
// Z Probe (when not Z_STOP_PIN)
80+
//
81+
#define Z_MIN_PROBE_PIN PA6 // BLTouch
82+
83+
//
84+
// Filament Runout Sensor
85+
//
86+
#ifndef FIL_RUNOUT_PIN
87+
#define FIL_RUNOUT_PIN E0_DIAG_PIN // E0-DET
88+
#endif
89+
#ifndef FIL_RUNOUT2_PIN
90+
#define FIL_RUNOUT2_PIN E1_DIAG_PIN // E1-DET
91+
#endif
92+
93+
//
94+
// Power Supply Control
95+
//
96+
#ifndef PS_ON_PIN
97+
#define PS_ON_PIN PA9 // PS-ON
98+
#endif
99+
100+
//
101+
// Power Loss Detection
102+
//
103+
#ifndef POWER_LOSS_PIN
104+
#define POWER_LOSS_PIN PB9 // PWRDET
105+
#endif
106+
107+
//
108+
// Steppers
109+
//
110+
#define X_STEP_PIN PA14
111+
#define X_DIR_PIN PA10
112+
#define X_ENABLE_PIN PA13
113+
#ifndef X_CS_PIN
114+
#define X_CS_PIN PB8
115+
#endif
116+
117+
#define Y_STEP_PIN PC8
118+
#define Y_DIR_PIN PA15
119+
#define Y_ENABLE_PIN PC14
120+
#ifndef Y_CS_PIN
121+
#define Y_CS_PIN PC9
122+
#endif
123+
124+
#define Z_STEP_PIN PD2
125+
#define Z_DIR_PIN PD4
126+
#define Z_ENABLE_PIN PD3
127+
#ifndef Z_CS_PIN
128+
#define Z_CS_PIN PD0
129+
#endif
130+
131+
#define E0_STEP_PIN PD5
132+
#define E0_DIR_PIN PD6
133+
#define E0_ENABLE_PIN PB3
134+
#ifndef E0_CS_PIN
135+
#define E0_CS_PIN PD1
136+
#endif
137+
138+
#define E1_STEP_PIN PB7
139+
#define E1_DIR_PIN PB6
140+
#define E1_ENABLE_PIN PB4
141+
#ifndef E1_CS_PIN
142+
#define E1_CS_PIN PB5
143+
#endif
144+
145+
//
146+
// Software SPI pins for TMC2130 stepper drivers
147+
//
148+
#if ENABLED(TMC_USE_SW_SPI)
149+
#ifndef TMC_SW_MOSI
150+
#define TMC_SW_MOSI PC12 // Shared with SPI header, Pin 5 (SPI3)
151+
#endif
152+
#ifndef TMC_SW_MISO
153+
#define TMC_SW_MISO PC11 // Shared with SPI header, Pin 6 (SPI3)
154+
#endif
155+
#ifndef TMC_SW_SCK
156+
#define TMC_SW_SCK PC10 // Shared with SPI header, Pin 4 (SPI3)
157+
#endif
158+
#endif
159+
160+
#if HAS_TMC_UART
161+
#define X_SERIAL_TX_PIN PB8 // X_CS_PIN
162+
#define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
163+
164+
#define Y_SERIAL_TX_PIN PC9 // Y_CS_PIN
165+
#define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
166+
167+
#define Z_SERIAL_TX_PIN PD0 // Z_CS_PIN
168+
#define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
169+
170+
#define E0_SERIAL_TX_PIN PD1 // E0_CS_PIN
171+
#define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
172+
173+
#define E1_SERIAL_TX_PIN PB5 // E1_CS_PIN
174+
#define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN
175+
176+
// Reduce baud rate to improve software serial reliability
177+
#define TMC_BAUD_RATE 19200
178+
#endif
179+
180+
//
181+
// Temperature Sensors
182+
//
183+
#define TEMP_0_PIN PA4 // Analog Input "TH0"
184+
#define TEMP_1_PIN PA5 // Analog Input "TH1"
185+
#define TEMP_BED_PIN PA3 // Analog Input "TB"
186+
187+
//
188+
// Heaters / Fans
189+
//
190+
#define HEATER_0_PIN PB11 // "HE0"
191+
#define HEATER_1_PIN PB10 // "HE1"
192+
#define HEATER_BED_PIN PB2 // "HB"
193+
194+
#define FAN_PIN PA8 // "FAN0"
195+
#define FAN1_PIN PB15 // "FAN1"
196+
#define FAN2_PIN PB14 // "FAN2"
197+
198+
//
199+
// Auto fans
200+
//
201+
#if HOTENDS == 2
202+
#ifndef E0_AUTO_FAN_PIN
203+
#define E0_AUTO_FAN_PIN FAN1_PIN
204+
#endif
205+
#ifndef E1_AUTO_FAN_PIN
206+
#define E1_AUTO_FAN_PIN FAN2_PIN
207+
#endif
208+
#else
209+
#ifndef E0_AUTO_FAN_PIN
210+
#define E0_AUTO_FAN_PIN FAN1_PIN
211+
#endif
212+
#ifndef CONTROLLER_FAN_PIN
213+
#define CONTROLLER_FAN_PIN FAN2_PIN
214+
#endif
215+
#endif
216+
217+
/**
218+
* Manta E3 EZ V1.0
219+
* ------
220+
* (BEEPER) PC1 | 1 2 | PC2 (BTN_ENC)
221+
* (BTN_EN1) PC3 | 3 4 | RESET
222+
* (BTN_EN2) PC0 5 6 | PA0 (LCD_D4)
223+
* (LCD_RS) PA2 | 7 8 | PA1 (LCD_EN)
224+
* GND | 9 10 | 5V
225+
* ------
226+
* EXP1
227+
*/
228+
#define EXP1_01_PIN PC1
229+
#define EXP1_02_PIN PC2
230+
#define EXP1_03_PIN PC3
231+
#define EXP1_04_PIN -1
232+
#define EXP1_05_PIN PC0
233+
#define EXP1_06_PIN PA0
234+
#define EXP1_07_PIN PA2
235+
#define EXP1_08_PIN PA1
236+
#define EXP1_09_PIN -1
237+
#define EXP1_10_PIN -1
238+
239+
#if HAS_DWIN_E3V2 || IS_DWIN_MARLINUI
240+
#ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
241+
#error "CAUTION! Ender-3 V2 display requires a custom cable with TX = PA0, RX = PC2. See 'pins_BTT_MANTA_E3_EZ_V1_0.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
242+
#endif
243+
244+
/**
245+
* Ender-3 V2 display Manta E3 EZ V1.0 Ender-3 V2 display --> Manta E3 EZ V1.0
246+
* ------ ------ RX 3 --> 5 P0_15
247+
* -- | 1 2 | -- (BEEPER) PC1 | 1 2 | PC2 (BTN_ENC) TX 4 --> 9 P0_16
248+
* (MANTA TX1) RX | 3 4 | TX (MANTA RX1) (BTN_EN1) PC3 | 3 4 | RESET BEEPER 6 --> 10 P2_08
249+
* (BTN_ENC) ENT 5 6 | BEEPER (BTN_EN2) PC0 5 6 | PA0 (LCD_D4)
250+
* (BTN_E2) B | 7 8 | A (BTN_E1) (LCD_RS) PA2 | 7 8 | PA1 (LCD_EN)
251+
* GND | 9 10 | 5V GND | 9 10 | 5V
252+
* ------ ------
253+
*/
254+
255+
#define BEEPER_PIN EXP1_01_PIN
256+
#define BTN_EN1 EXP1_08_PIN
257+
#define BTN_EN2 EXP1_07_PIN
258+
#define BTN_ENC EXP1_05_PIN
259+
260+
#elif HAS_WIRED_LCD
261+
262+
#if ENABLED(CR10_STOCKDISPLAY)
263+
264+
#define BEEPER_PIN EXP1_01_PIN
265+
266+
#define BTN_EN1 EXP1_03_PIN
267+
#define BTN_EN2 EXP1_05_PIN
268+
#define BTN_ENC EXP1_02_PIN
269+
270+
#define LCD_PINS_RS EXP1_07_PIN
271+
#define LCD_PINS_ENABLE EXP1_08_PIN
272+
#define LCD_PINS_D4 EXP1_06_PIN
273+
274+
#elif ENABLED(ZONESTAR_LCD) // ANET A8 LCD Controller - Must convert to 3.3V - CONNECTING TO 5V WILL DAMAGE THE BOARD!
275+
276+
#ifndef NO_CONTROLLER_CUSTOM_WIRING_WARNING
277+
#error "CAUTION! ZONESTAR_LCD requires wiring modifications. See 'pins_BTT_MANTA_E3_EZ_V1_0.h' for details. (Define NO_CONTROLLER_CUSTOM_WIRING_WARNING to suppress this warning.)"
278+
#endif
279+
280+
#define LCD_PINS_RS EXP1_06_PIN
281+
#define LCD_PINS_ENABLE EXP1_02_PIN
282+
#define LCD_PINS_D4 EXP1_07_PIN
283+
#define LCD_PINS_D5 EXP1_05_PIN
284+
#define LCD_PINS_D6 EXP1_03_PIN
285+
#define LCD_PINS_D7 EXP1_01_PIN
286+
#define ADC_KEYPAD_PIN PA7 // Repurpose default SERVO0_PIN for ADC - CONNECTING TO 5V WILL DAMAGE THE BOARD!
287+
288+
#elif EITHER(MKS_MINI_12864, ENDER2_STOCKDISPLAY)
289+
290+
#define BTN_EN1 EXP1_03_PIN
291+
#define BTN_EN2 EXP1_05_PIN
292+
#define BTN_ENC EXP1_02_PIN
293+
294+
#define DOGLCD_CS EXP1_07_PIN
295+
#define DOGLCD_A0 EXP1_06_PIN
296+
#define DOGLCD_SCK EXP1_01_PIN
297+
#define DOGLCD_MOSI EXP1_08_PIN
298+
#define FORCE_SOFT_SPI
299+
#define LCD_BACKLIGHT_PIN -1
300+
301+
#else
302+
303+
#error "Only ZONESTAR_LCD, MKS_MINI_12864, ENDER2_STOCKDISPLAY, and CR10_STOCKDISPLAY are currently supported on the BTT_MANTA_E3_EZ_V1_0."
304+
305+
#endif
306+
307+
#endif // HAS_WIRED_LCD
308+
309+
//
310+
// SD Support
311+
//
312+
313+
#ifndef SDCARD_CONNECTION
314+
#define SDCARD_CONNECTION ONBOARD
315+
#endif
316+
317+
#define SD_DETECT_PIN -1
318+
319+
#if SD_CONNECTION_IS(LCD) && (BOTH(TOUCH_UI_FTDI_EVE, LCD_FYSETC_TFT81050) || IS_TFTGLCD_PANEL)
320+
#define SD_SS_PIN EXP1_05_PIN
321+
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
322+
#error "SD CUSTOM_CABLE is not compatible with Manta E3 EZ."
323+
#endif
324+
325+
#define ONBOARD_SPI_DEVICE 3 // SPI3 -> used only by HAL/STM32F1...
326+
#define ONBOARD_SD_CS_PIN PC13 // Chip select for "System" SD card
327+
328+
#define ENABLE_SPI3
329+
#define SDSS ONBOARD_SD_CS_PIN
330+
#define SD_SS_PIN ONBOARD_SD_CS_PIN
331+
#define SD_SCK_PIN PC10
332+
#define SD_MISO_PIN PC11
333+
#define SD_MOSI_PIN PC12
334+
335+
//
336+
// NeoPixel LED
337+
//
338+
#ifndef NEOPIXEL_PIN
339+
#define NEOPIXEL_PIN PC7 // RGB
340+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,313 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4+
*
5+
* Based on Sprinter and grbl.
6+
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
*
21+
*/
22+
#pragma once
23+
24+
#include "env_validate.h"
25+
26+
//#define BOARD_CUSTOM_BUILD_FLAGS -DTONE_CHANNEL=4 -DTONE_TIMER=4 -DTIMER_TONE=4
27+
28+
#ifndef BOARD_INFO_NAME
29+
#define BOARD_INFO_NAME "BTT Manta M4P V1.0"
30+
#endif
31+
32+
#define USES_DIAG_JUMPERS
33+
34+
// Ignore temp readings during development.
35+
//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
36+
37+
//
38+
// EEPROM
39+
//
40+
#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
41+
#undef NO_EEPROM_SELECTED
42+
#ifndef FLASH_EEPROM_EMULATION
43+
#define FLASH_EEPROM_EMULATION
44+
#endif
45+
#define EEPROM_PAGE_SIZE (0x800UL) // 2K
46+
#define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
47+
#define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE
48+
#endif
49+
50+
//
51+
// Servos
52+
//
53+
#define SERVO0_PIN PA1 // SERVOS
54+
55+
//
56+
// Probe enable
57+
//
58+
#if ENABLED(PROBE_ENABLE_DISABLE)
59+
#ifndef PROBE_ENABLE_PIN
60+
#define PROBE_ENABLE_PIN SERVO0_PIN
61+
#endif
62+
#endif
63+
64+
//
65+
// Limit Switches
66+
//
67+
#define X_STOP_PIN PC0 // X-STOP
68+
#define Y_STOP_PIN PC1 // Y-STOP
69+
#define Z_STOP_PIN PC2 // Z-STOP
70+
71+
//
72+
// Z Probe must be this pin
73+
//
74+
#define Z_MIN_PROBE_PIN PC14 // PROBE
75+
76+
//
77+
// Filament Runout Sensor
78+
//
79+
#ifndef FIL_RUNOUT_PIN
80+
#define FIL_RUNOUT_PIN PC15 // E0-STOP
81+
#endif
82+
83+
//
84+
// Steppers
85+
//
86+
#define X_STEP_PIN PC6
87+
#define X_DIR_PIN PA14
88+
#define X_ENABLE_PIN PC7
89+
#ifndef X_CS_PIN
90+
#define X_CS_PIN PB12
91+
#endif
92+
93+
#define Y_STEP_PIN PB10
94+
#define Y_DIR_PIN PB2
95+
#define Y_ENABLE_PIN PB11
96+
#ifndef Y_CS_PIN
97+
#define Y_CS_PIN PC10
98+
#endif
99+
100+
#define Z_STEP_PIN PB0
101+
#define Z_DIR_PIN PC5
102+
#define Z_ENABLE_PIN PB1
103+
#ifndef Z_CS_PIN
104+
#define Z_CS_PIN PC9
105+
#endif
106+
107+
#define E0_STEP_PIN PB3
108+
#define E0_DIR_PIN PB4
109+
#define E0_ENABLE_PIN PD5
110+
#ifndef E0_CS_PIN
111+
#define E0_CS_PIN PA13
112+
#endif
113+
114+
//
115+
// Software SPI pins for TMC2130 stepper drivers
116+
//
117+
#if ENABLED(TMC_USE_SW_SPI)
118+
#ifndef TMC_SW_MOSI
119+
#define TMC_SW_MOSI PB15
120+
#endif
121+
#ifndef TMC_SW_MISO
122+
#define TMC_SW_MISO PB14
123+
#endif
124+
#ifndef TMC_SW_SCK
125+
#define TMC_SW_SCK PB13
126+
#endif
127+
#endif
128+
129+
#if HAS_TMC_UART
130+
#define X_SERIAL_TX_PIN PB12
131+
#define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
132+
133+
#define Y_SERIAL_TX_PIN PC10
134+
#define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
135+
136+
#define Z_SERIAL_TX_PIN PC9
137+
#define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
138+
139+
#define E0_SERIAL_TX_PIN PA13
140+
#define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
141+
142+
// Reduce baud rate to improve software serial reliability
143+
#define TMC_BAUD_RATE 19200
144+
#endif
145+
146+
//
147+
// Temperature Sensors
148+
//
149+
#define TEMP_0_PIN PA0 // Analog Input "TH0"
150+
#define TEMP_BED_PIN PC4 // Analog Input "TB0"
151+
152+
//
153+
// Heaters / Fans
154+
//
155+
#define HEATER_0_PIN PC8 // "HE"
156+
#define HEATER_BED_PIN PD8 // "HB"
157+
158+
#define FAN_PIN PD2 // "FAN0"
159+
#define FAN1_PIN PD3 // "FAN1"
160+
#define FAN2_PIN PD4 // "FAN2"
161+
162+
/**
163+
* ------ ------
164+
* (BEEPER) PD6 | 1 2 | PB8 (BTN_ENC) (MISO) PB14 | 1 2 | PB13 (SCK)
165+
* (LCD_EN) PB9 | 3 4 | PC3 (LCD_RS) (BTN_EN1) PC11 | 3 4 | PA8 (SD_SS)
166+
* (LCD_D4) PA15 | 5 6 PA10 (LCD_D5) (BTN_EN2) PC12 | 5 6 PB15 (MOSI)
167+
* (LCD_D6) PA9 | 7 8 | PB5 (LCD_D7) (SD_DETECT) PC13 | 7 8 | RESET
168+
* GND | 9 10 | 5V GND | 9 10 | --
169+
* ------ ------
170+
* EXP1 EXP2
171+
*/
172+
#define EXP1_01_PIN PD6
173+
#define EXP1_02_PIN PB8
174+
#define EXP1_03_PIN PB9
175+
#define EXP1_04_PIN PC3
176+
#define EXP1_05_PIN PA15
177+
#define EXP1_06_PIN PA10
178+
#define EXP1_07_PIN PA9
179+
#define EXP1_08_PIN PB5
180+
181+
#define EXP2_01_PIN PB14
182+
#define EXP2_02_PIN PB13
183+
#define EXP2_03_PIN PC11
184+
#define EXP2_04_PIN PA8
185+
#define EXP2_05_PIN PC12
186+
#define EXP2_06_PIN PB15
187+
#define EXP2_07_PIN PC13
188+
#define EXP2_08_PIN -1
189+
190+
//
191+
// Onboard SD card
192+
// Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2
193+
//
194+
#if SD_CONNECTION_IS(LCD)
195+
#define SDSS EXP2_04_PIN
196+
#define SD_SS_PIN SDSS
197+
#define SD_SCK_PIN EXP2_02_PIN
198+
#define SD_MISO_PIN EXP2_01_PIN
199+
#define SD_MOSI_PIN EXP2_06_PIN
200+
#define SD_DETECT_PIN EXP2_07_PIN
201+
#elif SD_CONNECTION_IS(ONBOARD)
202+
#define SD_SCK_PIN PA5
203+
#define SD_MISO_PIN PA6
204+
#define SD_MOSI_PIN PA7
205+
#define ONBOARD_SD_CS_PIN PA4 // Chip select for "System" SD card
206+
#define SD_SS_PIN ONBOARD_SD_CS_PIN
207+
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
208+
#error "No custom SD drive cable defined for this board."
209+
#endif
210+
211+
//
212+
// LCDs and Controllers
213+
//
214+
#if IS_TFTGLCD_PANEL
215+
216+
#if ENABLED(TFTGLCD_PANEL_SPI)
217+
#define TFTGLCD_CS EXP2_03_PIN
218+
#endif
219+
220+
#elif HAS_WIRED_LCD
221+
222+
#define BEEPER_PIN EXP1_01_PIN
223+
#define BTN_ENC EXP1_02_PIN
224+
225+
#if ENABLED(CR10_STOCKDISPLAY)
226+
227+
#define LCD_PINS_RS EXP1_07_PIN
228+
229+
#define BTN_EN1 EXP1_03_PIN
230+
#define BTN_EN2 EXP1_05_PIN
231+
232+
#define LCD_PINS_ENABLE EXP1_08_PIN
233+
#define LCD_PINS_D4 EXP1_06_PIN
234+
235+
#elif ENABLED(MKS_MINI_12864)
236+
237+
#define DOGLCD_A0 EXP1_07_PIN
238+
#define DOGLCD_CS EXP1_06_PIN
239+
#define BTN_EN1 EXP2_03_PIN
240+
#define BTN_EN2 EXP2_05_PIN
241+
242+
#else
243+
244+
#define LCD_PINS_RS EXP1_04_PIN
245+
246+
#define BTN_EN1 EXP2_03_PIN
247+
#define BTN_EN2 EXP2_05_PIN
248+
249+
#define LCD_PINS_ENABLE EXP1_03_PIN
250+
#define LCD_PINS_D4 EXP1_05_PIN
251+
252+
#if ENABLED(FYSETC_MINI_12864)
253+
#define DOGLCD_CS EXP1_03_PIN
254+
#define DOGLCD_A0 EXP1_04_PIN
255+
//#define LCD_BACKLIGHT_PIN -1
256+
257+
#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
258+
// results in LCD soft SPI mode 3, SD soft SPI mode 0
259+
260+
#define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally.
261+
#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
262+
#ifndef RGB_LED_R_PIN
263+
#define RGB_LED_R_PIN EXP1_06_PIN
264+
#endif
265+
#ifndef RGB_LED_G_PIN
266+
#define RGB_LED_G_PIN EXP1_07_PIN
267+
#endif
268+
#ifndef RGB_LED_B_PIN
269+
#define RGB_LED_B_PIN EXP1_08_PIN
270+
#endif
271+
#elif ENABLED(FYSETC_MINI_12864_2_1)
272+
#define NEOPIXEL_PIN EXP1_06_PIN
273+
#endif
274+
#endif // !FYSETC_MINI_12864
275+
276+
#if IS_ULTIPANEL
277+
#define LCD_PINS_D5 EXP1_06_PIN
278+
#define LCD_PINS_D6 EXP1_07_PIN
279+
#define LCD_PINS_D7 EXP1_08_PIN
280+
281+
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
282+
#define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
283+
#endif
284+
285+
#endif
286+
287+
#endif
288+
289+
#endif // HAS_WIRED_LCD
290+
291+
// Alter timing for graphical display
292+
#if IS_U8GLIB_ST7920
293+
#ifndef BOARD_ST7920_DELAY_1
294+
#define BOARD_ST7920_DELAY_1 120
295+
#endif
296+
#ifndef BOARD_ST7920_DELAY_2
297+
#define BOARD_ST7920_DELAY_2 80
298+
#endif
299+
#ifndef BOARD_ST7920_DELAY_3
300+
#define BOARD_ST7920_DELAY_3 580
301+
#endif
302+
#endif
303+
304+
//
305+
// NeoPixel LED
306+
//
307+
#ifndef NEOPIXEL_PIN
308+
#define NEOPIXEL_PIN PD0
309+
#endif
310+
311+
#ifndef NEOPIXEL2_PIN
312+
#define NEOPIXEL2_PIN PD1
313+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,341 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4+
*
5+
* Based on Sprinter and grbl.
6+
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
*
21+
*/
22+
#pragma once
23+
24+
#include "env_validate.h"
25+
26+
#ifndef BOARD_INFO_NAME
27+
#define BOARD_INFO_NAME "BTT Manta M5P V1.0"
28+
#endif
29+
30+
#define USES_DIAG_JUMPERS
31+
32+
// Ignore temp readings during development.
33+
//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
34+
35+
//
36+
// EEPROM
37+
//
38+
#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
39+
#undef NO_EEPROM_SELECTED
40+
#ifndef FLASH_EEPROM_EMULATION
41+
#define FLASH_EEPROM_EMULATION
42+
#endif
43+
#define EEPROM_PAGE_SIZE (0x800UL) // 2K
44+
#define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
45+
#define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE
46+
#endif
47+
48+
//
49+
// Servos
50+
//
51+
#define SERVO0_PIN PC15 // PROBE
52+
53+
//
54+
// Probe enable
55+
//
56+
#if ENABLED(PROBE_ENABLE_DISABLE)
57+
#ifndef PROBE_ENABLE_PIN
58+
#define PROBE_ENABLE_PIN SERVO0_PIN
59+
#endif
60+
#endif
61+
62+
//
63+
// Trinamic StallGuard pins
64+
//
65+
#define X_DIAG_PIN PD3 // MIN1
66+
#define Y_DIAG_PIN PD2 // MIN2
67+
#define Z_DIAG_PIN PC3 // MIN3
68+
#define E0_DIAG_PIN PC2 // MIN4
69+
#define E1_DIAG_PIN -1
70+
71+
//
72+
// Limit Switches
73+
//
74+
#define X_STOP_PIN X_DIAG_PIN // MIN1
75+
#define Y_STOP_PIN Y_DIAG_PIN // MIN1
76+
#define Z_STOP_PIN Z_DIAG_PIN // MIN3
77+
78+
//
79+
// Z Probe (when not Z_STOP_PIN)
80+
//
81+
#ifndef Z_MIN_PROBE_PIN
82+
#define Z_MIN_PROBE_PIN PC13 // PROBE
83+
//#define Z_MIN_PROBE_PIN PC15 // IND-DET (with adjustable pullup set via jumper)
84+
#endif
85+
86+
//
87+
// Filament Runout Sensor
88+
//
89+
#ifndef FIL_RUNOUT_PIN
90+
#define FIL_RUNOUT_PIN E0_DIAG_PIN // MIN4
91+
#endif
92+
93+
//
94+
// Steppers
95+
//
96+
#define X_STEP_PIN PC8
97+
#define X_DIR_PIN PC9
98+
#define X_ENABLE_PIN PA15
99+
#ifndef X_CS_PIN
100+
#define X_CS_PIN PD9
101+
#endif
102+
103+
#define Y_STEP_PIN PA10
104+
#define Y_DIR_PIN PA14
105+
#define Y_ENABLE_PIN PA13
106+
#ifndef Y_CS_PIN
107+
#define Y_CS_PIN PD8
108+
#endif
109+
110+
#define Z_STEP_PIN PC6
111+
#define Z_DIR_PIN PC7
112+
#define Z_ENABLE_PIN PA9
113+
#ifndef Z_CS_PIN
114+
#define Z_CS_PIN PB10
115+
#endif
116+
117+
#define E0_STEP_PIN PB12
118+
#define E0_DIR_PIN PB11
119+
#define E0_ENABLE_PIN PA8
120+
#ifndef E0_CS_PIN
121+
#define E0_CS_PIN PB2
122+
#endif
123+
124+
#define E1_STEP_PIN PB0
125+
#define E1_DIR_PIN PB1
126+
#define E1_ENABLE_PIN PC4
127+
#ifndef E1_CS_PIN
128+
#define E1_CS_PIN PA6
129+
#endif
130+
131+
//
132+
// Software SPI pins for TMC2130 stepper drivers
133+
//
134+
#if ENABLED(TMC_USE_SW_SPI)
135+
#ifndef TMC_SW_MOSI
136+
#define TMC_SW_MOSI PB15 // Shared with SPI header, Pin 5 (SPI2)
137+
#endif
138+
#ifndef TMC_SW_MISO
139+
#define TMC_SW_MISO PB14 // Shared with SPI header, Pin 6 (SPI2)
140+
#endif
141+
#ifndef TMC_SW_SCK
142+
#define TMC_SW_SCK PB13 // Shared with SPI header, Pin 4 (SPI2)
143+
#endif
144+
#endif
145+
146+
#if HAS_TMC_UART
147+
#define X_SERIAL_TX_PIN PD9 // X_CS_PIN
148+
#define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
149+
150+
#define Y_SERIAL_TX_PIN PD8 // Y_CS_PIN
151+
#define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
152+
153+
#define Z_SERIAL_TX_PIN PB10 // Z_CS_PIN
154+
#define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
155+
156+
#define E0_SERIAL_TX_PIN PB2 // E0_CS_PIN
157+
#define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
158+
159+
#define E1_SERIAL_TX_PIN PA6 // E1_CS_PIN
160+
#define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN
161+
162+
// Reduce baud rate to improve software serial reliability
163+
#define TMC_BAUD_RATE 19200
164+
#endif
165+
166+
//
167+
// Temperature Sensors
168+
//
169+
#define TEMP_0_PIN PA1 // Analog Input "TH0"
170+
#define TEMP_1_PIN PA2 // Analog Input "TH1"
171+
#define TEMP_BED_PIN PA0 // Analog Input "TB"
172+
173+
//
174+
// Heaters / Fans
175+
//
176+
#define HEATER_0_PIN PC5 // "HE0"
177+
#define HEATER_1_PIN PA7 // "HE1"
178+
#define HEATER_BED_PIN PA5 // "HB"
179+
180+
#define FAN_PIN PA4 // "FAN0"
181+
#define FAN1_PIN PA3 // "FAN1"
182+
183+
//
184+
// Auto fans
185+
//
186+
#ifndef E0_AUTO_FAN_PIN
187+
#define E0_AUTO_FAN_PIN FAN1_PIN
188+
#endif
189+
190+
/**
191+
* ------ ------
192+
* (BEEPER) PD5 | 1 2 | PD4 (BTN_ENC) (MISO) PB14 | 1 2 | PB13 (SCK)
193+
* (LCD_EN) PB3 | 3 4 | PD6 (LCD_RS) (BTN_EN1) PB8 | 3 4 | PB9 (SD_SS)
194+
* (LCD_D4) PB5 | 5 6 PB4 (LCD_D5) (BTN_EN2) PC10 | 5 6 PB15 (MOSI)
195+
* (LCD_D6) PB7 | 7 8 | PB6 (LCD_D7) (SD_DETECT) PC12 | 7 8 | PF2
196+
* GND | 9 10 | 5V GND | 9 10 | --
197+
* ------ ------
198+
* EXP1 EXP2
199+
*/
200+
#define EXP1_01_PIN PD5
201+
#define EXP1_02_PIN PD4
202+
#define EXP1_03_PIN PB3
203+
#define EXP1_04_PIN PD6
204+
#define EXP1_05_PIN PB5
205+
#define EXP1_06_PIN PB4
206+
#define EXP1_07_PIN PB7
207+
#define EXP1_08_PIN PB6
208+
209+
#define EXP2_01_PIN PB14
210+
#define EXP2_02_PIN PB13
211+
#define EXP2_03_PIN PB8
212+
#define EXP2_04_PIN PB9
213+
#define EXP2_05_PIN PC10
214+
#define EXP2_06_PIN PB15
215+
#define EXP2_07_PIN PC12
216+
#define EXP2_08_PIN -1
217+
218+
//
219+
// Onboard SD card
220+
// Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2
221+
//
222+
#if SD_CONNECTION_IS(LCD)
223+
#define SDSS EXP2_04_PIN
224+
#define SD_SS_PIN SDSS
225+
#define SD_SCK_PIN EXP2_02_PIN
226+
#define SD_MISO_PIN EXP2_01_PIN
227+
#define SD_MOSI_PIN EXP2_06_PIN
228+
#define SD_DETECT_PIN EXP2_07_PIN
229+
#elif SD_CONNECTION_IS(ONBOARD)
230+
#define SD_SCK_PIN PB13
231+
#define SD_MISO_PIN PB14
232+
#define SD_MOSI_PIN PB15
233+
#define ONBOARD_SD_CS_PIN PC1 // Chip select for "System" SD card
234+
#define SD_SS_PIN ONBOARD_SD_CS_PIN
235+
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
236+
#error "No custom SD drive cable defined for this board."
237+
#endif
238+
239+
//
240+
// LCDs and Controllers
241+
//
242+
#if IS_TFTGLCD_PANEL
243+
244+
#if ENABLED(TFTGLCD_PANEL_SPI)
245+
#define TFTGLCD_CS EXP2_03_PIN
246+
#endif
247+
248+
#elif HAS_WIRED_LCD
249+
250+
#define BEEPER_PIN EXP1_01_PIN
251+
#define BTN_ENC EXP1_02_PIN
252+
253+
#if ENABLED(CR10_STOCKDISPLAY)
254+
255+
#define LCD_PINS_RS EXP1_07_PIN
256+
257+
#define BTN_EN1 EXP1_03_PIN
258+
#define BTN_EN2 EXP1_05_PIN
259+
260+
#define LCD_PINS_ENABLE EXP1_08_PIN
261+
#define LCD_PINS_D4 EXP1_06_PIN
262+
263+
#elif ENABLED(MKS_MINI_12864)
264+
265+
#define DOGLCD_A0 EXP1_07_PIN
266+
#define DOGLCD_CS EXP1_06_PIN
267+
#define BTN_EN1 EXP2_03_PIN
268+
#define BTN_EN2 EXP2_05_PIN
269+
270+
#else
271+
272+
#define LCD_PINS_RS EXP1_04_PIN
273+
274+
#define BTN_EN1 EXP2_03_PIN
275+
#define BTN_EN2 EXP2_05_PIN
276+
277+
#define LCD_PINS_ENABLE EXP1_03_PIN
278+
#define LCD_PINS_D4 EXP1_05_PIN
279+
280+
#if ENABLED(FYSETC_MINI_12864)
281+
#define DOGLCD_CS EXP1_03_PIN
282+
#define DOGLCD_A0 EXP1_04_PIN
283+
//#define LCD_BACKLIGHT_PIN -1
284+
285+
#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
286+
// results in LCD soft SPI mode 3, SD soft SPI mode 0
287+
288+
#define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally.
289+
#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
290+
#ifndef RGB_LED_R_PIN
291+
#define RGB_LED_R_PIN EXP1_06_PIN
292+
#endif
293+
#ifndef RGB_LED_G_PIN
294+
#define RGB_LED_G_PIN EXP1_07_PIN
295+
#endif
296+
#ifndef RGB_LED_B_PIN
297+
#define RGB_LED_B_PIN EXP1_08_PIN
298+
#endif
299+
#elif ENABLED(FYSETC_MINI_12864_2_1)
300+
#define NEOPIXEL_PIN EXP1_06_PIN
301+
#endif
302+
#endif // !FYSETC_MINI_12864
303+
304+
#if IS_ULTIPANEL
305+
#define LCD_PINS_D5 EXP1_06_PIN
306+
#define LCD_PINS_D6 EXP1_07_PIN
307+
#define LCD_PINS_D7 EXP1_08_PIN
308+
309+
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
310+
#define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
311+
#endif
312+
313+
#endif
314+
315+
#endif
316+
317+
#endif // HAS_WIRED_LCD
318+
319+
// Alter timing for graphical display
320+
#if IS_U8GLIB_ST7920
321+
#ifndef BOARD_ST7920_DELAY_1
322+
#define BOARD_ST7920_DELAY_1 120
323+
#endif
324+
#ifndef BOARD_ST7920_DELAY_2
325+
#define BOARD_ST7920_DELAY_2 80
326+
#endif
327+
#ifndef BOARD_ST7920_DELAY_3
328+
#define BOARD_ST7920_DELAY_3 580
329+
#endif
330+
#endif
331+
332+
//
333+
// NeoPixel LED
334+
//
335+
#ifndef NEOPIXEL_PIN
336+
#define NEOPIXEL_PIN PC11 // RGB1
337+
#endif
338+
339+
#ifndef NEOPIXEL2_PIN
340+
#define NEOPIXEL2_PIN PC14 // RGB2
341+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4+
*
5+
* Based on Sprinter and grbl.
6+
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
*
21+
*/
22+
#pragma once
23+
24+
// Include common Manta M8P pins
25+
#include "pins_BTT_MANTA_M8P_common.h"
26+
27+
#ifndef BOARD_INFO_NAME
28+
#define BOARD_INFO_NAME "BTT Manta M8P V1.0"
29+
#endif
30+
31+
//
32+
// Steppers
33+
//
34+
35+
#define E1_STEP_PIN PA10 // M6
36+
#define E1_DIR_PIN PD15
37+
#define E1_ENABLE_PIN PA15
38+
#ifndef E1_CS_PIN
39+
#define E1_CS_PIN PF8
40+
#endif
41+
42+
#define E2_STEP_PIN PD12 // M7
43+
#define E2_DIR_PIN PD11
44+
#define E2_ENABLE_PIN PD14
45+
#ifndef E2_CS_PIN
46+
#define E2_CS_PIN PD13
47+
#endif
48+
49+
#define E3_STEP_PIN PD10 // M8
50+
#define E3_DIR_PIN PD8
51+
#define E3_ENABLE_PIN PD9
52+
#ifndef E3_CS_PIN
53+
#define E3_CS_PIN PC7
54+
#endif
55+
56+
#if HAS_TMC_UART
57+
#define E1_SERIAL_TX_PIN PF8
58+
#define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN
59+
60+
#define E2_SERIAL_TX_PIN PD13
61+
#define E2_SERIAL_RX_PIN E2_SERIAL_TX_PIN
62+
63+
#define E3_SERIAL_TX_PIN PC7
64+
#define E3_SERIAL_RX_PIN E3_SERIAL_TX_PIN
65+
66+
// Reduce baud rate to improve software serial reliability
67+
#define TMC_BAUD_RATE 19200
68+
#endif
69+
70+
//
71+
// NeoPixel LED
72+
//
73+
#ifndef NEOPIXEL_PIN
74+
#define NEOPIXEL_PIN PC6
75+
#endif
76+
77+
#ifndef NEOPIXEL2_PIN
78+
#define NEOPIXEL2_PIN PA9
79+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4+
*
5+
* Based on Sprinter and grbl.
6+
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
*
21+
*/
22+
#pragma once
23+
24+
// Include common Manta M8P pins
25+
#include "pins_BTT_MANTA_M8P_common.h"
26+
27+
#ifndef BOARD_INFO_NAME
28+
#define BOARD_INFO_NAME "BTT Manta M8P V1.1"
29+
#endif
30+
31+
//
32+
// Steppers
33+
//
34+
#define E1_STEP_PIN PA10 // M6
35+
#define E1_DIR_PIN PA14
36+
#define E1_ENABLE_PIN PA15
37+
#ifndef E1_CS_PIN
38+
#define E1_CS_PIN PF8
39+
#endif
40+
41+
#define E2_STEP_PIN PD11 // M7
42+
#define E2_DIR_PIN PD9
43+
#define E2_ENABLE_PIN PD15
44+
#ifndef E2_CS_PIN
45+
#define E2_CS_PIN PD14
46+
#endif
47+
48+
#define E3_STEP_PIN PD8 // M8
49+
#define E3_DIR_PIN PC6
50+
#define E3_ENABLE_PIN PC7
51+
#ifndef E3_CS_PIN
52+
#define E3_CS_PIN PD10
53+
#endif
54+
55+
#if HAS_TMC_UART
56+
#define E1_SERIAL_TX_PIN PF8
57+
#define E1_SERIAL_RX_PIN E1_SERIAL_TX_PIN
58+
59+
#define E2_SERIAL_TX_PIN PD14
60+
#define E2_SERIAL_RX_PIN E2_SERIAL_TX_PIN
61+
62+
#define E3_SERIAL_TX_PIN PD10
63+
#define E3_SERIAL_RX_PIN E3_SERIAL_TX_PIN
64+
65+
// Reduce baud rate to improve software serial reliability
66+
#define TMC_BAUD_RATE 19200
67+
#endif
68+
69+
//
70+
// NeoPixel LED
71+
//
72+
#ifndef NEOPIXEL_PIN
73+
#define NEOPIXEL_PIN PA9
74+
#endif
75+
76+
#ifndef NEOPIXEL2_PIN
77+
#define NEOPIXEL2_PIN PB15
78+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,397 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4+
*
5+
* Based on Sprinter and grbl.
6+
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7+
*
8+
* This program is free software: you can redistribute it and/or modify
9+
* it under the terms of the GNU General Public License as published by
10+
* the Free Software Foundation, either version 3 of the License, or
11+
* (at your option) any later version.
12+
*
13+
* This program is distributed in the hope that it will be useful,
14+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
* GNU General Public License for more details.
17+
*
18+
* You should have received a copy of the GNU General Public License
19+
* along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
*
21+
*/
22+
#pragma once
23+
24+
#include "env_validate.h"
25+
26+
//#define BOARD_CUSTOM_BUILD_FLAGS -DTONE_CHANNEL=4 -DTONE_TIMER=4 -DTIMER_TONE=4
27+
28+
#define USES_DIAG_JUMPERS
29+
30+
// Ignore temp readings during development.
31+
//#define BOGUS_TEMPERATURE_GRACE_PERIOD 2000
32+
33+
//
34+
// EEPROM
35+
//
36+
#if EITHER(NO_EEPROM_SELECTED, FLASH_EEPROM_EMULATION)
37+
#undef NO_EEPROM_SELECTED
38+
#ifndef FLASH_EEPROM_EMULATION
39+
#define FLASH_EEPROM_EMULATION
40+
#endif
41+
#define EEPROM_PAGE_SIZE (0x800UL) // 2K
42+
#define EEPROM_START_ADDRESS (0x8000000UL + (STM32_FLASH_SIZE) * 1024UL - (EEPROM_PAGE_SIZE) * 2UL)
43+
#define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE
44+
#endif
45+
46+
//
47+
// Servos
48+
//
49+
#define SERVO0_PIN PB1 // PROBE
50+
51+
//
52+
// Probe enable
53+
//
54+
#if ENABLED(PROBE_ENABLE_DISABLE)
55+
#ifndef PROBE_ENABLE_PIN
56+
#define PROBE_ENABLE_PIN SERVO0_PIN
57+
#endif
58+
#endif
59+
60+
//
61+
// Trinamic Stallguard pins
62+
//
63+
#define X_DIAG_PIN PF3 // MIN1
64+
#define Y_DIAG_PIN PF4 // MIN2
65+
#define Z_DIAG_PIN PF5 // MIN3
66+
#define Z2_DIAG_PIN PC0 // MIN4
67+
#define E0_DIAG_PIN PC1 // MIN5
68+
#define E1_DIAG_PIN PC2 // MIN6
69+
70+
//
71+
// Z Probe (when not Z_MIN_PIN)
72+
//
73+
#ifndef Z_MIN_PROBE_PIN
74+
#define Z_MIN_PROBE_PIN PB2 // PROBE
75+
//#define Z_MIN_PROBE_PIN PF6 // IND-PROBE (with adjustable voltage & pullup set via jumpers)
76+
#endif
77+
78+
//
79+
// Check for additional used endstop pins
80+
//
81+
#if HAS_EXTRA_ENDSTOPS
82+
#define _ENDSTOP_IS_ANY(ES) X2_USE_ENDSTOP == ES || Y2_USE_ENDSTOP == ES || Z2_USE_ENDSTOP == ES || Z3_USE_ENDSTOP == ES || Z4_USE_ENDSTOP == ES
83+
#if _ENDSTOP_IS_ANY(_XMIN_) || _ENDSTOP_IS_ANY(_XMAX_)
84+
#define NEEDS_X_MINMAX 1
85+
#endif
86+
#if _ENDSTOP_IS_ANY(_YMIN_) || _ENDSTOP_IS_ANY(_YMAX_)
87+
#define NEEDS_Y_MINMAX 1
88+
#endif
89+
#undef _ENDSTOP_IS_ANY
90+
#endif
91+
92+
//
93+
// Limit Switches
94+
//
95+
#ifdef X_STALL_SENSITIVITY
96+
#define X_STOP_PIN X_DIAG_PIN
97+
#if X_HOME_TO_MIN
98+
#define X_MAX_PIN E0_DIAG_PIN // MIN5
99+
#else
100+
#define X_MIN_PIN E0_DIAG_PIN // MIN5
101+
#endif
102+
#elif EITHER(DUAL_X_CARRIAGE, NEEDS_X_MINMAX)
103+
#ifndef X_MIN_PIN
104+
#define X_MIN_PIN X_DIAG_PIN // MIN1
105+
#endif
106+
#ifndef X_MAX_PIN
107+
#define X_MAX_PIN E0_DIAG_PIN // MIN5
108+
#endif
109+
#else
110+
#define X_STOP_PIN X_DIAG_PIN // MIN1
111+
#endif
112+
113+
#ifdef Y_STALL_SENSITIVITY
114+
#define Y_STOP_PIN Y_DIAG_PIN
115+
#if Y_HOME_TO_MIN
116+
#define Y_MAX_PIN E1_DIAG_PIN // MIN6
117+
#else
118+
#define Y_MIN_PIN E1_DIAG_PIN // MIN6
119+
#endif
120+
#elif NEEDS_Y_MINMAX
121+
#ifndef Y_MIN_PIN
122+
#define Y_MIN_PIN Y_DIAG_PIN // MIN2
123+
#endif
124+
#ifndef Y_MAX_PIN
125+
#define Y_MAX_PIN E1_DIAG_PIN // MIN6
126+
#endif
127+
#else
128+
#define Y_STOP_PIN Y_DIAG_PIN // MIN2
129+
#endif
130+
131+
#define Z_STOP_PIN Z_DIAG_PIN // MIN3
132+
133+
#undef NEEDS_X_MINMAX
134+
#undef NEEDS_Y_MINMAX
135+
136+
//
137+
// Filament Runout Sensors
138+
//
139+
#define FIL_RUNOUT_PIN PC1 // MIN5
140+
#define FIL_RUNOUT2_PIN PC2 // MIN6
141+
142+
#ifndef PS_ON_PIN
143+
#define PS_ON_PIN PC3 // PS-ON
144+
#endif
145+
146+
//
147+
// Steppers
148+
//
149+
#define X_STEP_PIN PE2 // M1
150+
#define X_DIR_PIN PB4
151+
#define X_ENABLE_PIN PC11
152+
#ifndef X_CS_PIN
153+
#define X_CS_PIN PC10
154+
#endif
155+
156+
#define Y_STEP_PIN PF12 // M2
157+
#define Y_DIR_PIN PF11
158+
#define Y_ENABLE_PIN PB3
159+
#ifndef Y_CS_PIN
160+
#define Y_CS_PIN PF13
161+
#endif
162+
163+
#define Z_STEP_PIN PD7 // M3
164+
#define Z_DIR_PIN PD6
165+
#define Z_ENABLE_PIN PF10
166+
#ifndef Z_CS_PIN
167+
#define Z_CS_PIN PF9
168+
#endif
169+
170+
#define Z2_STEP_PIN PD3 // M4
171+
#define Z2_DIR_PIN PD2
172+
#define Z2_ENABLE_PIN PD5
173+
#ifndef Z2_CS_PIN
174+
#define Z2_CS_PIN PD4
175+
#endif
176+
177+
#define E0_STEP_PIN PC9 // M5
178+
#define E0_DIR_PIN PC8
179+
#define E0_ENABLE_PIN PD1
180+
#ifndef E0_CS_PIN
181+
#define E0_CS_PIN PD0
182+
#endif
183+
184+
//
185+
// Software SPI pins for TMC2130 stepper drivers
186+
//
187+
#if ENABLED(TMC_USE_SW_SPI)
188+
#ifndef TMC_SW_MOSI
189+
#define TMC_SW_MOSI PA7
190+
#endif
191+
#ifndef TMC_SW_MISO
192+
#define TMC_SW_MISO PA6
193+
#endif
194+
#ifndef TMC_SW_SCK
195+
#define TMC_SW_SCK PA5
196+
#endif
197+
#endif
198+
199+
#if HAS_TMC_UART
200+
#define X_SERIAL_TX_PIN PC10
201+
#define X_SERIAL_RX_PIN X_SERIAL_TX_PIN
202+
203+
#define Y_SERIAL_TX_PIN PF13
204+
#define Y_SERIAL_RX_PIN Y_SERIAL_TX_PIN
205+
206+
#define Z_SERIAL_TX_PIN PF9
207+
#define Z_SERIAL_RX_PIN Z_SERIAL_TX_PIN
208+
209+
#define Z2_SERIAL_TX_PIN PD4
210+
#define Z2_SERIAL_RX_PIN Z2_SERIAL_TX_PIN
211+
212+
#define E0_SERIAL_TX_PIN PD0
213+
#define E0_SERIAL_RX_PIN E0_SERIAL_TX_PIN
214+
215+
// Reduce baud rate to improve software serial reliability
216+
#define TMC_BAUD_RATE 19200
217+
#endif
218+
219+
//
220+
// Temperature Sensors
221+
//
222+
#define TEMP_BED_PIN PA0 // TB
223+
#define TEMP_0_PIN PA1 // TH0
224+
#define TEMP_1_PIN PA2 // TH1
225+
#define TEMP_2_PIN PA3 // TH2
226+
#define TEMP_3_PIN PA4 // TH3
227+
228+
//
229+
// Heaters / Fans
230+
//
231+
#define HEATER_BED_PIN PB7 // BED-OUT
232+
#define HEATER_0_PIN PE3 // HE0
233+
#define HEATER_1_PIN PB5 // HE1
234+
#define HEATER_2_PIN PB6 // HE2
235+
#define HEATER_3_PIN PE1 // HE3
236+
237+
#define FAN_PIN PE6 // FAN0
238+
#define FAN1_PIN PE0 // FAN1
239+
#define FAN2_PIN PC12 // FAN2
240+
#define FAN3_PIN PE5 // FAN3
241+
#define FAN4_PIN PE4 // FAN4
242+
#define FAN5_PIN PB8 // FAN5
243+
#define FAN6_PIN PB9 // FAN6
244+
245+
//
246+
// SD Support
247+
//
248+
#ifndef SDCARD_CONNECTION
249+
#if HAS_WIRED_LCD
250+
#define SDCARD_CONNECTION LCD
251+
#else
252+
#define SDCARD_CONNECTION ONBOARD
253+
#endif
254+
#endif
255+
256+
/**
257+
* ------ ------
258+
* (BEEPER) PE9 | 1 2 | PE10 (BTN_ENC) (MISO) PB14 | 1 2 | PB13 (SCK)
259+
* (LCD_EN) PE11 | 3 4 | PE12 (LCD_RS) (BTN_EN1) PF7 | 3 4 | PB12 (SD_SS)
260+
* (LCD_D4) PE13 | 5 6 PE14 (LCD_D5) (BTN_EN2) PE7 | 5 6 PB11 (MOSI)
261+
* (LCD_D6) PE15 | 7 8 | PB10 (LCD_D7) (SD_DETECT) PE8 | 7 8 | RESET
262+
* GND | 9 10 | 5V GND | 9 10 | --
263+
* ------ ------
264+
* EXP1 EXP2
265+
*/
266+
#define EXP1_01_PIN PE9
267+
#define EXP1_02_PIN PE10
268+
#define EXP1_03_PIN PE11
269+
#define EXP1_04_PIN PE12
270+
#define EXP1_05_PIN PE13
271+
#define EXP1_06_PIN PE14
272+
#define EXP1_07_PIN PE15
273+
#define EXP1_08_PIN PB10
274+
275+
#define EXP2_01_PIN PB14
276+
#define EXP2_02_PIN PB13
277+
#define EXP2_03_PIN PF7
278+
#define EXP2_04_PIN PB12
279+
#define EXP2_05_PIN PE7
280+
#define EXP2_06_PIN PB11
281+
#define EXP2_07_PIN PE8
282+
#define EXP2_08_PIN -1
283+
284+
//
285+
// Onboard SD card
286+
// Must use soft SPI because Marlin's default hardware SPI is tied to LCD's EXP2
287+
//
288+
#if SD_CONNECTION_IS(LCD)
289+
#define SDSS EXP2_04_PIN
290+
#define SD_SS_PIN SDSS
291+
#define SD_SCK_PIN EXP2_02_PIN
292+
#define SD_MISO_PIN EXP2_01_PIN
293+
#define SD_MOSI_PIN EXP2_06_PIN
294+
#define SD_DETECT_PIN EXP2_07_PIN
295+
#elif SD_CONNECTION_IS(ONBOARD)
296+
#define SD_DETECT_PIN PE8
297+
#define SD_SCK_PIN PB13
298+
#define SD_MISO_PIN PB14
299+
#define SD_MOSI_PIN PB11
300+
#define ONBOARD_SD_CS_PIN PB14 // Chip select for "System" SD card
301+
#define SD_SS_PIN ONBOARD_SD_CS_PIN
302+
#elif SD_CONNECTION_IS(CUSTOM_CABLE)
303+
#error "No custom SD drive cable defined for this board."
304+
#endif
305+
306+
//
307+
// LCDs and Controllers
308+
//
309+
#if IS_TFTGLCD_PANEL
310+
311+
#if ENABLED(TFTGLCD_PANEL_SPI)
312+
#define TFTGLCD_CS EXP2_03_PIN
313+
#endif
314+
315+
#elif HAS_WIRED_LCD
316+
317+
#define BEEPER_PIN EXP1_01_PIN
318+
#define BTN_ENC EXP1_02_PIN
319+
320+
#if ENABLED(CR10_STOCKDISPLAY)
321+
322+
#define LCD_PINS_RS EXP1_07_PIN
323+
324+
#define BTN_EN1 EXP1_03_PIN
325+
#define BTN_EN2 EXP1_05_PIN
326+
327+
#define LCD_PINS_ENABLE EXP1_08_PIN
328+
#define LCD_PINS_D4 EXP1_06_PIN
329+
330+
#elif ENABLED(MKS_MINI_12864)
331+
332+
#define DOGLCD_A0 EXP1_07_PIN
333+
#define DOGLCD_CS EXP1_06_PIN
334+
#define BTN_EN1 EXP2_03_PIN
335+
#define BTN_EN2 EXP2_05_PIN
336+
337+
#else
338+
339+
#define LCD_PINS_RS EXP1_04_PIN
340+
341+
#define BTN_EN1 EXP2_03_PIN
342+
#define BTN_EN2 EXP2_05_PIN
343+
344+
#define LCD_PINS_ENABLE EXP1_03_PIN
345+
#define LCD_PINS_D4 EXP1_05_PIN
346+
347+
#if ENABLED(FYSETC_MINI_12864)
348+
#define DOGLCD_CS EXP1_03_PIN
349+
#define DOGLCD_A0 EXP1_04_PIN
350+
//#define LCD_BACKLIGHT_PIN -1
351+
352+
#define FORCE_SOFT_SPI // Use this if default of hardware SPI causes display problems
353+
// results in LCD soft SPI mode 3, SD soft SPI mode 0
354+
355+
#define LCD_RESET_PIN EXP1_05_PIN // Must be high or open for LCD to operate normally.
356+
#if EITHER(FYSETC_MINI_12864_1_2, FYSETC_MINI_12864_2_0)
357+
#ifndef RGB_LED_R_PIN
358+
#define RGB_LED_R_PIN EXP1_06_PIN
359+
#endif
360+
#ifndef RGB_LED_G_PIN
361+
#define RGB_LED_G_PIN EXP1_07_PIN
362+
#endif
363+
#ifndef RGB_LED_B_PIN
364+
#define RGB_LED_B_PIN EXP1_08_PIN
365+
#endif
366+
#elif ENABLED(FYSETC_MINI_12864_2_1)
367+
#define NEOPIXEL_PIN EXP1_06_PIN
368+
#endif
369+
#endif // !FYSETC_MINI_12864
370+
371+
#if IS_ULTIPANEL
372+
#define LCD_PINS_D5 EXP1_06_PIN
373+
#define LCD_PINS_D6 EXP1_07_PIN
374+
#define LCD_PINS_D7 EXP1_08_PIN
375+
376+
#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
377+
#define BTN_ENC_EN LCD_PINS_D7 // Detect the presence of the encoder
378+
#endif
379+
380+
#endif
381+
382+
#endif
383+
384+
#endif // HAS_WIRED_LCD
385+
386+
// Alter timing for graphical display
387+
#if IS_U8GLIB_ST7920
388+
#ifndef BOARD_ST7920_DELAY_1
389+
#define BOARD_ST7920_DELAY_1 120
390+
#endif
391+
#ifndef BOARD_ST7920_DELAY_2
392+
#define BOARD_ST7920_DELAY_2 80
393+
#endif
394+
#ifndef BOARD_ST7920_DELAY_3
395+
#define BOARD_ST7920_DELAY_3 580
396+
#endif
397+
#endif

‎Marlin/src/pins/stm32g0/pins_BTT_SKR_MINI_E3_V3_0.h

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
*/
2222
#pragma once
2323

24+
#include "env_validate.h"
25+
2426
//#define BOARD_CUSTOM_BUILD_FLAGS -DTONE_CHANNEL=4 -DTONE_TIMER=4 -DTIMER_TONE=4
2527

2628
#ifndef BOARD_INFO_NAME
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
{
2+
"build": {
3+
"core": "stm32",
4+
"cpu": "cortex-m0plus",
5+
"extra_flags": "-DSTM32G0xx -DSTM32G0B1xx",
6+
"f_cpu": "64000000L",
7+
"framework_extra_flags": {
8+
"arduino": "-D__CORTEX_SC=0"
9+
},
10+
"mcu": "stm32g0b1vet6",
11+
"product_line": "STM32G0B1xx",
12+
"variant": "MARLIN_G0B1VE"
13+
},
14+
"debug": {
15+
"default_tools": [
16+
"stlink"
17+
],
18+
"jlink_device": "STM32G0B1VE",
19+
"onboard_tools": [
20+
"stlink"
21+
],
22+
"openocd_target": "stm32g0x",
23+
"svd_path": "STM32G0B1.svd"
24+
},
25+
"frameworks": [
26+
"arduino",
27+
"cmsis",
28+
"libopencm3",
29+
"stm32cube",
30+
"zephyr"
31+
],
32+
"name": "STM32G0B1VE",
33+
"upload": {
34+
"maximum_ram_size": 147456,
35+
"maximum_size": 524288,
36+
"protocol": "stlink",
37+
"protocols": [
38+
"stlink",
39+
"jlink",
40+
"cmsis-dap",
41+
"blackmagic",
42+
"mbed"
43+
]
44+
},
45+
"url": "https://www.st.com/content/st_com/en/products/microcontrollers-microprocessors/stm32-32-bit-arm-cortex-mcus/stm32-mainstream-mcus/stm32g0-series/stm32g0x1.html",
46+
"vendor": "ST"
47+
}

‎buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/PeripheralPins.c

+2
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ WEAK const PinMap PinMap_UART_TX[] = {
218218
{PC_12, USART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_USART5)},
219219
{PD_3, USART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_USART5)},
220220
{PD_5, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART2)},
221+
{PD_8, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART3)},
221222
{PF_2, LPUART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_LPUART2)},
222223
{NC, NP, 0}
223224
};
@@ -252,6 +253,7 @@ WEAK const PinMap PinMap_UART_RX[] = {
252253
{PC_11_ALT1, USART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_USART4)},
253254
{PD_2, USART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_USART5)},
254255
{PD_6, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF0_USART2)},
256+
{PD_9, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF4_USART3)},
255257
{NC, NP, 0}
256258
};
257259
#endif

‎buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.cpp

+1-8
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,7 @@ WEAK void SystemClock_Config(void)
130130
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
131131

132132
// Reset clock registers (in case bootloader has changed them)
133-
RCC->CR |= RCC_CR_HSION;
134-
while (!(RCC->CR & RCC_CR_HSIRDY))
135-
;
136-
RCC->CFGR = 0x00000000;
137-
RCC->CR = RCC_CR_HSION;
138-
while (RCC->CR & RCC_CR_PLLRDY)
139-
;
140-
RCC->PLLCFGR = 0x00001000;
133+
SystemInit();
141134

142135
/** Configure the main internal regulator output voltage
143136
*/

‎buildroot/share/PlatformIO/variants/MARLIN_G0B1RE/variant_MARLIN_STM32G0B1RE.h

+12
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@
158158
#endif
159159

160160
// UART Definitions
161+
//#define ENABLE_HWSERIAL1 done automatically by the #define SERIAL_UART_INSTANCE below
162+
#define ENABLE_HWSERIAL3
163+
161164
#ifndef SERIAL_UART_INSTANCE
162165
#define SERIAL_UART_INSTANCE 2
163166
#endif
@@ -171,6 +174,15 @@
171174
#define PIN_SERIAL_TX PA2
172175
#endif
173176

177+
// Optional PIN_SERIALn_RX and PIN_SERIALn_TX where 'n' is the U(S)ART number
178+
// Used when user instantiate a hardware Serial using its peripheral name.
179+
// Example: HardwareSerial mySerial(USART3);
180+
// will use PIN_SERIAL3_RX and PIN_SERIAL3_TX if defined.
181+
#define PIN_SERIAL1_RX PA3
182+
#define PIN_SERIAL1_TX PA2
183+
#define PIN_SERIAL3_RX PD9
184+
#define PIN_SERIAL3_TX PD8
185+
174186
/*----------------------------------------------------------------------------
175187
* Arduino objects - C++ only
176188
*----------------------------------------------------------------------------*/

‎buildroot/share/PlatformIO/variants/MARLIN_G0B1VE/PeripheralPins.c

+480
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/* Remap pin name */
2+
PA_9_R = PA_9 | PREMAP,
3+
PA_10_R = PA_10 | PREMAP,
4+
5+
/* Alternate pin name */
6+
PA_1_ALT1 = PA_1 | ALT1,
7+
PA_2_ALT1 = PA_2 | ALT1,
8+
PA_3_ALT1 = PA_3 | ALT1,
9+
PA_4_ALT1 = PA_4 | ALT1,
10+
PA_6_ALT1 = PA_6 | ALT1,
11+
PA_6_ALT2 = PA_6 | ALT2,
12+
PA_7_ALT1 = PA_7 | ALT1,
13+
PA_7_ALT2 = PA_7 | ALT2,
14+
PA_7_ALT3 = PA_7 | ALT3,
15+
PA_9_ALT1 = PA_9 | ALT1,
16+
PA_9_R_ALT1 = PA_9_R | ALT1,
17+
PA_10_ALT1 = PA_10 | ALT1,
18+
PA_10_R_ALT1 = PA_10_R | ALT1,
19+
PA_14_ALT1 = PA_14 | ALT1,
20+
PA_15_ALT1 = PA_15 | ALT1,
21+
PB_0_ALT1 = PB_0 | ALT1,
22+
PB_1_ALT1 = PB_1 | ALT1,
23+
PB_1_ALT2 = PB_1 | ALT2,
24+
PB_3_ALT1 = PB_3 | ALT1,
25+
PB_4_ALT1 = PB_4 | ALT1,
26+
PB_5_ALT1 = PB_5 | ALT1,
27+
PB_6_ALT1 = PB_6 | ALT1,
28+
PB_6_ALT2 = PB_6 | ALT2,
29+
PB_7_ALT1 = PB_7 | ALT1,
30+
PB_8_ALT1 = PB_8 | ALT1,
31+
PB_9_ALT1 = PB_9 | ALT1,
32+
PB_13_ALT1 = PB_13 | ALT1,
33+
PB_14_ALT1 = PB_14 | ALT1,
34+
PB_15_ALT1 = PB_15 | ALT1,
35+
PB_15_ALT2 = PB_15 | ALT2,
36+
PC_0_ALT1 = PC_0 | ALT1,
37+
PC_1_ALT1 = PC_1 | ALT1,
38+
PC_4_ALT1 = PC_4 | ALT1,
39+
PC_5_ALT1 = PC_5 | ALT1,
40+
PC_6_ALT1 = PC_6 | ALT1,
41+
PC_7_ALT1 = PC_7 | ALT1,
42+
PC_8_ALT1 = PC_8 | ALT1,
43+
PC_9_ALT1 = PC_9 | ALT1,
44+
PC_10_ALT1 = PC_10 | ALT1,
45+
PC_11_ALT1 = PC_11 | ALT1,
46+
PD_4_ALT1 = PD_4 | ALT1,
47+
PF_7_ALT1 = PF_7 | ALT1,
48+
49+
/* SYS_WKUP */
50+
#ifdef PWR_WAKEUP_PIN1
51+
SYS_WKUP1 = PA_0,
52+
#endif
53+
#ifdef PWR_WAKEUP_PIN2
54+
SYS_WKUP2 = PC_13,
55+
#endif
56+
#ifdef PWR_WAKEUP_PIN3
57+
SYS_WKUP3 = PE_6,
58+
#endif
59+
#ifdef PWR_WAKEUP_PIN4
60+
SYS_WKUP4 = PA_2,
61+
#endif
62+
#ifdef PWR_WAKEUP_PIN5
63+
SYS_WKUP5 = PC_5,
64+
#endif
65+
#ifdef PWR_WAKEUP_PIN6
66+
SYS_WKUP6 = PB_5,
67+
#endif
68+
#ifdef PWR_WAKEUP_PIN7
69+
SYS_WKUP7 = NC,
70+
#endif
71+
#ifdef PWR_WAKEUP_PIN8
72+
SYS_WKUP8 = NC,
73+
#endif
74+
75+
/* USB */
76+
#ifdef USBCON
77+
USB_DM = PA_11,
78+
USB_DP = PA_12,
79+
#ifdef USB_NOE_PA_4
80+
USB_NOE = PA_4,
81+
#endif
82+
#ifdef USB_NOE_PA_13
83+
USB_NOE = PA_13,
84+
#endif
85+
#ifdef USB_NOE_PA_15
86+
USB_NOE = PA_15,
87+
#endif
88+
#ifdef USB_NOE_PC_9
89+
USB_NOE = PC_9,
90+
#endif
91+
#endif
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,177 @@
1+
/**
2+
******************************************************************************
3+
* @file LinkerScript.ld
4+
* @author Auto-generated by STM32CubeIDE
5+
* @brief Linker script for STM32G0B1VETx Device from STM32G0 series
6+
* 512Kbytes FLASH
7+
* 144Kbytes RAM
8+
*
9+
* Set heap size, stack size and stack location according
10+
* to application requirements.
11+
*
12+
* Set memory bank area and size if external memory is used
13+
******************************************************************************
14+
* @attention
15+
*
16+
* <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
17+
* All rights reserved.</center></h2>
18+
*
19+
* This software component is licensed by ST under BSD 3-Clause license,
20+
* the "License"; You may not use this file except in compliance with the
21+
* License. You may obtain a copy of the License at:
22+
* opensource.org/licenses/BSD-3-Clause
23+
*
24+
******************************************************************************
25+
*/
26+
27+
/* Entry Point */
28+
ENTRY(Reset_Handler)
29+
30+
/* Highest address of the user mode stack */
31+
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
32+
33+
_Min_Heap_Size = 0x200; /* required amount of heap */
34+
_Min_Stack_Size = 0x400; /* required amount of stack */
35+
36+
/* Memories definition */
37+
MEMORY
38+
{
39+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
40+
FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
41+
}
42+
43+
/* Sections */
44+
SECTIONS
45+
{
46+
/* The startup code into "FLASH" Rom type memory */
47+
.isr_vector :
48+
{
49+
. = ALIGN(4);
50+
KEEP(*(.isr_vector)) /* Startup code */
51+
. = ALIGN(4);
52+
} >FLASH
53+
54+
/* The program code and other data into "FLASH" Rom type memory */
55+
.text :
56+
{
57+
. = ALIGN(4);
58+
*(.text) /* .text sections (code) */
59+
*(.text*) /* .text* sections (code) */
60+
*(.glue_7) /* glue arm to thumb code */
61+
*(.glue_7t) /* glue thumb to arm code */
62+
*(.eh_frame)
63+
64+
KEEP (*(.init))
65+
KEEP (*(.fini))
66+
67+
. = ALIGN(4);
68+
_etext = .; /* define a global symbols at end of code */
69+
} >FLASH
70+
71+
/* Constant data into "FLASH" Rom type memory */
72+
.rodata :
73+
{
74+
. = ALIGN(4);
75+
*(.rodata) /* .rodata sections (constants, strings, etc.) */
76+
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
77+
. = ALIGN(4);
78+
} >FLASH
79+
80+
.ARM.extab : {
81+
. = ALIGN(4);
82+
*(.ARM.extab* .gnu.linkonce.armextab.*)
83+
. = ALIGN(4);
84+
} >FLASH
85+
86+
.ARM : {
87+
. = ALIGN(4);
88+
__exidx_start = .;
89+
*(.ARM.exidx*)
90+
__exidx_end = .;
91+
. = ALIGN(4);
92+
} >FLASH
93+
94+
.preinit_array :
95+
{
96+
. = ALIGN(4);
97+
PROVIDE_HIDDEN (__preinit_array_start = .);
98+
KEEP (*(.preinit_array*))
99+
PROVIDE_HIDDEN (__preinit_array_end = .);
100+
. = ALIGN(4);
101+
} >FLASH
102+
103+
.init_array :
104+
{
105+
. = ALIGN(4);
106+
PROVIDE_HIDDEN (__init_array_start = .);
107+
KEEP (*(SORT(.init_array.*)))
108+
KEEP (*(.init_array*))
109+
PROVIDE_HIDDEN (__init_array_end = .);
110+
. = ALIGN(4);
111+
} >FLASH
112+
113+
.fini_array :
114+
{
115+
. = ALIGN(4);
116+
PROVIDE_HIDDEN (__fini_array_start = .);
117+
KEEP (*(SORT(.fini_array.*)))
118+
KEEP (*(.fini_array*))
119+
PROVIDE_HIDDEN (__fini_array_end = .);
120+
. = ALIGN(4);
121+
} >FLASH
122+
123+
/* Used by the startup to initialize data */
124+
_sidata = LOADADDR(.data);
125+
126+
/* Initialized data sections into "RAM" Ram type memory */
127+
.data :
128+
{
129+
. = ALIGN(4);
130+
_sdata = .; /* create a global symbol at data start */
131+
*(.data) /* .data sections */
132+
*(.data*) /* .data* sections */
133+
*(.RamFunc) /* .RamFunc sections */
134+
*(.RamFunc*) /* .RamFunc* sections */
135+
136+
. = ALIGN(4);
137+
_edata = .; /* define a global symbol at data end */
138+
139+
} >RAM AT> FLASH
140+
141+
/* Uninitialized data section into "RAM" Ram type memory */
142+
. = ALIGN(4);
143+
.bss :
144+
{
145+
/* This is used by the startup in order to initialize the .bss section */
146+
_sbss = .; /* define a global symbol at bss start */
147+
__bss_start__ = _sbss;
148+
*(.bss)
149+
*(.bss*)
150+
*(COMMON)
151+
152+
. = ALIGN(4);
153+
_ebss = .; /* define a global symbol at bss end */
154+
__bss_end__ = _ebss;
155+
} >RAM
156+
157+
/* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
158+
._user_heap_stack :
159+
{
160+
. = ALIGN(8);
161+
PROVIDE ( end = . );
162+
PROVIDE ( _end = . );
163+
. = . + _Min_Heap_Size;
164+
. = . + _Min_Stack_Size;
165+
. = ALIGN(8);
166+
} >RAM
167+
168+
/* Remove information from the compiler libraries */
169+
/DISCARD/ :
170+
{
171+
libc.a ( * )
172+
libm.a ( * )
173+
libgcc.a ( * )
174+
}
175+
176+
.ARM.attributes 0 : { *(.ARM.attributes) }
177+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2020-2021, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* This software component is licensed by ST under BSD 3-Clause license,
7+
* the "License"; You may not use this file except in compliance with the
8+
* License. You may obtain a copy of the License at:
9+
* opensource.org/licenses/BSD-3-Clause
10+
*
11+
*******************************************************************************
12+
*/
13+
14+
#if defined(STM32G0B1xx)
15+
#include "pins_arduino.h"
16+
17+
// Digital PinName array
18+
const PinName digitalPin[] = {
19+
PA_0, // D0/A0
20+
PA_1, // D1/A1
21+
PA_2, // D2/A2
22+
PA_3, // D3/A3
23+
PA_4, // D4/A4
24+
PA_5, // D5/A5
25+
PA_6, // D6/A6
26+
PA_7, // D7/A7
27+
PA_8, // D8
28+
PA_9, // D9
29+
PA_10, // D10
30+
PA_11, // D11
31+
PA_12, // D12
32+
PA_13, // D13
33+
PA_14, // D14
34+
PA_15, // D15
35+
PB_0, // D16/A8
36+
PB_1, // D17/A9
37+
PB_2, // D18/A10
38+
PB_3, // D19
39+
PB_4, // D20
40+
PB_5, // D21
41+
PB_6, // D22
42+
PB_7, // D23
43+
PB_8, // D24
44+
PB_9, // D25
45+
PB_10, // D26/A11
46+
PB_11, // D27/A12
47+
PB_12, // D28/A13
48+
PB_13, // D29
49+
PB_14, // D30
50+
PB_15, // D31
51+
PC_0, // D32
52+
PC_1, // D33
53+
PC_2, // D34
54+
PC_3, // D35
55+
PC_4, // D36/A14
56+
PC_5, // D37/A15
57+
PC_6, // D38
58+
PC_7, // D39
59+
PC_8, // D40
60+
PC_9, // D41
61+
PC_10, // D42
62+
PC_11, // D43
63+
PC_12, // D44
64+
PC_13, // D45
65+
PC_14, // D46
66+
PC_15, // D47
67+
PD_0, // D48
68+
PD_1, // D49
69+
PD_2, // D50
70+
PD_3, // D51
71+
PD_4, // D52
72+
PD_5, // D53
73+
PD_6, // D54
74+
PD_7, // D55
75+
PD_8, // D56
76+
PD_9, // D57
77+
PD_10, // D58
78+
PD_11, // D59
79+
PD_12, // D60
80+
PD_13, // D61
81+
PD_14, // D62
82+
PD_15, // D63
83+
PE_0, // D64
84+
PE_1, // D65
85+
PE_2, // D66
86+
PE_3, // D67
87+
PE_4, // D68
88+
PE_5, // D69
89+
PE_6, // D70
90+
PE_7, // D71
91+
PE_8, // D72
92+
PE_9, // D73
93+
PE_10, // D74
94+
PE_11, // D75
95+
PE_12, // D76
96+
PE_13, // D77
97+
PE_14, // D78
98+
PE_15, // D79
99+
PF_0, // D80
100+
PF_1, // D81
101+
PF_2, // D82
102+
PF_3, // D83
103+
PF_4, // D84
104+
PF_5, // D85
105+
PF_6, // D86
106+
PF_7, // D87
107+
PF_8, // D88
108+
PF_9, // D89
109+
PF_10, // D90
110+
PF_11, // D91
111+
PF_12, // D92
112+
PF_13, // D93
113+
PA_9_R, // D94
114+
PA_10_R // D95
115+
};
116+
117+
// Analog (Ax) pin number array
118+
const uint32_t analogInputPin[] = {
119+
0, // A0, PA0
120+
1, // A1, PA1
121+
2, // A2, PA2
122+
3, // A3, PA3
123+
4, // A4, PA4
124+
5, // A5, PA5
125+
6, // A6, PA6
126+
7, // A7, PA7
127+
16, // A8, PB0
128+
17, // A9, PB1
129+
18, // A10, PB2
130+
26, // A11, PB10
131+
27, // A12, PB11
132+
28, // A13, PB12
133+
36, // A14, PC4
134+
37 // A15, PC5
135+
};
136+
137+
// ----------------------------------------------------------------------------
138+
139+
#ifdef __cplusplus
140+
extern "C" {
141+
#endif
142+
143+
/**
144+
* @brief System Clock Configuration
145+
* The system Clock is configured as follows :
146+
* System Clock source = PLL (HSE)
147+
* SYSCLK(Hz) = 64000000
148+
* HCLK(Hz) = 64000000
149+
* AHB Prescaler = 1
150+
* APB1 Prescaler = 1
151+
* PLL_M = 1
152+
* PLL_N = 24
153+
* PLL_R = 3
154+
* PLL_P = 2
155+
* PLL_Q = 4
156+
* USB(Hz) = 48000000 (PLLQ)
157+
* @param None
158+
* @retval None
159+
*/
160+
WEAK void SystemClock_Config(void)
161+
{
162+
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
163+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
164+
RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
165+
166+
// Reset clock registers (in case bootloader has changed them)
167+
SystemInit();
168+
169+
/** Configure the main internal regulator output voltage
170+
*/
171+
HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1);
172+
/** Initializes the RCC Oscillators according to the specified parameters
173+
* in the RCC_OscInitTypeDef structure.
174+
*/
175+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
176+
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
177+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
178+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
179+
RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV1;
180+
RCC_OscInitStruct.PLL.PLLN = 24;
181+
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
182+
RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV4;
183+
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV3;
184+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
185+
{
186+
Error_Handler();
187+
}
188+
/** Initializes the CPU, AHB and APB buses clocks
189+
*/
190+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
191+
|RCC_CLOCKTYPE_PCLK1;
192+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
193+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
194+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
195+
196+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
197+
{
198+
Error_Handler();
199+
}
200+
/** Initializes the peripherals clocks
201+
*/
202+
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_USB;
203+
PeriphClkInit.UsbClockSelection = RCC_USBCLKSOURCE_PLL;
204+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
205+
{
206+
Error_Handler();
207+
}
208+
}
209+
210+
#ifdef __cplusplus
211+
}
212+
#endif
213+
#endif /* STM32G0B1xx */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2020-2021, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* This software component is licensed by ST under BSD 3-Clause license,
7+
* the "License"; You may not use this file except in compliance with the
8+
* License. You may obtain a copy of the License at:
9+
* opensource.org/licenses/BSD-3-Clause
10+
*
11+
*******************************************************************************
12+
*/
13+
#pragma once
14+
15+
/*----------------------------------------------------------------------------
16+
* STM32 pins number
17+
*----------------------------------------------------------------------------*/
18+
#define PA0 PIN_A0
19+
#define PA1 PIN_A1
20+
#define PA2 PIN_A2
21+
#define PA3 PIN_A3
22+
#define PA4 PIN_A4
23+
#define PA5 PIN_A5
24+
#define PA6 PIN_A6
25+
#define PA7 PIN_A7
26+
#define PA8 8
27+
#define PA9 9
28+
#define PA10 10
29+
#define PA11 11
30+
#define PA12 12
31+
#define PA13 13
32+
#define PA14 14
33+
#define PA15 15
34+
#define PB0 PIN_A8
35+
#define PB1 PIN_A9
36+
#define PB2 PIN_A10
37+
#define PB3 19
38+
#define PB4 20
39+
#define PB5 21
40+
#define PB6 22
41+
#define PB7 23
42+
#define PB8 24
43+
#define PB9 25
44+
#define PB10 PIN_A11
45+
#define PB11 PIN_A12
46+
#define PB12 PIN_A13
47+
#define PB13 29
48+
#define PB14 30
49+
#define PB15 31
50+
#define PC0 32
51+
#define PC1 33
52+
#define PC2 34
53+
#define PC3 35
54+
#define PC4 PIN_A14
55+
#define PC5 PIN_A15
56+
#define PC6 38
57+
#define PC7 39
58+
#define PC8 40
59+
#define PC9 41
60+
#define PC10 42
61+
#define PC11 43
62+
#define PC12 44
63+
#define PC13 45
64+
#define PC14 46
65+
#define PC15 47
66+
#define PD0 48
67+
#define PD1 49
68+
#define PD2 50
69+
#define PD3 51
70+
#define PD4 52
71+
#define PD5 53
72+
#define PD6 54
73+
#define PD7 55
74+
#define PD8 56
75+
#define PD9 57
76+
#define PD10 58
77+
#define PD11 59
78+
#define PD12 60
79+
#define PD13 61
80+
#define PD14 62
81+
#define PD15 63
82+
#define PE0 64
83+
#define PE1 65
84+
#define PE2 66
85+
#define PE3 67
86+
#define PE4 68
87+
#define PE5 69
88+
#define PE6 70
89+
#define PE7 71
90+
#define PE8 72
91+
#define PE9 73
92+
#define PE10 74
93+
#define PE11 75
94+
#define PE12 76
95+
#define PE13 77
96+
#define PE14 78
97+
#define PE15 79
98+
#define PF0 80
99+
#define PF1 81
100+
#define PF2 82
101+
#define PF3 83
102+
#define PF4 84
103+
#define PF5 85
104+
#define PF6 86
105+
#define PF7 87
106+
#define PF8 88
107+
#define PF9 89
108+
#define PF10 90
109+
#define PF11 91
110+
#define PF12 92
111+
#define PF13 93
112+
#define PA9_R 94
113+
#define PA10_R 95
114+
115+
// Alternate pins number
116+
#define PA1_ALT1 (PA1 | ALT1)
117+
#define PA2_ALT1 (PA2 | ALT1)
118+
#define PA3_ALT1 (PA3 | ALT1)
119+
#define PA4_ALT1 (PA4 | ALT1)
120+
#define PA6_ALT1 (PA6 | ALT1)
121+
#define PA6_ALT2 (PA6 | ALT2)
122+
#define PA7_ALT1 (PA7 | ALT1)
123+
#define PA7_ALT2 (PA7 | ALT2)
124+
#define PA7_ALT3 (PA7 | ALT3)
125+
#define PA9_ALT1 (PA9 | ALT1)
126+
#define PA9_R_ALT1 (PA9_R | ALT1)
127+
#define PA10_ALT1 (PA10 | ALT1)
128+
#define PA10_R_ALT1 (PA10_R | ALT1)
129+
#define PA14_ALT1 (PA14 | ALT1)
130+
#define PA15_ALT1 (PA15 | ALT1)
131+
#define PB0_ALT1 (PB0 | ALT1)
132+
#define PB1_ALT1 (PB1 | ALT1)
133+
#define PB1_ALT2 (PB1 | ALT2)
134+
#define PB3_ALT1 (PB3 | ALT1)
135+
#define PB4_ALT1 (PB4 | ALT1)
136+
#define PB5_ALT1 (PB5 | ALT1)
137+
#define PB6_ALT1 (PB6 | ALT1)
138+
#define PB6_ALT2 (PB6 | ALT2)
139+
#define PB7_ALT1 (PB7 | ALT1)
140+
#define PB8_ALT1 (PB8 | ALT1)
141+
#define PB9_ALT1 (PB9 | ALT1)
142+
#define PB13_ALT1 (PB13 | ALT1)
143+
#define PB14_ALT1 (PB14 | ALT1)
144+
#define PB15_ALT1 (PB15 | ALT1)
145+
#define PB15_ALT2 (PB15 | ALT2)
146+
#define PC0_ALT1 (PC0 | ALT1)
147+
#define PC1_ALT1 (PC1 | ALT1)
148+
#define PC4_ALT1 (PC4 | ALT1)
149+
#define PC5_ALT1 (PC5 | ALT1)
150+
#define PC6_ALT1 (PC6 | ALT1)
151+
#define PC7_ALT1 (PC7 | ALT1)
152+
#define PC8_ALT1 (PC8 | ALT1)
153+
#define PC9_ALT1 (PC9 | ALT1)
154+
#define PC10_ALT1 (PC10 | ALT1)
155+
#define PC11_ALT1 (PC11 | ALT1)
156+
#define PD4_ALT1 (PD4 | ALT1)
157+
#define PF7_ALT1 (PF7 | ALT1)
158+
159+
#define NUM_DIGITAL_PINS 96
160+
#define NUM_REMAP_PINS 2
161+
#define NUM_ANALOG_INPUTS 16
162+
163+
// On-board LED pin number
164+
#ifndef LED_BUILTIN
165+
#define LED_BUILTIN PNUM_NOT_DEFINED
166+
#endif
167+
168+
// On-board user button
169+
#ifndef USER_BTN
170+
#define USER_BTN PNUM_NOT_DEFINED
171+
#endif
172+
173+
// SPI definitions
174+
#ifndef PIN_SPI_SS
175+
#define PIN_SPI_SS PA4
176+
#endif
177+
#ifndef PIN_SPI_SS1
178+
#define PIN_SPI_SS1 PA15
179+
#endif
180+
#ifndef PIN_SPI_SS2
181+
#define PIN_SPI_SS2 PB0
182+
#endif
183+
#ifndef PIN_SPI_SS3
184+
#define PIN_SPI_SS3 PD9
185+
#endif
186+
#ifndef PIN_SPI_MOSI
187+
#define PIN_SPI_MOSI PA2
188+
#endif
189+
#ifndef PIN_SPI_MISO
190+
#define PIN_SPI_MISO PA6
191+
#endif
192+
#ifndef PIN_SPI_SCK
193+
#define PIN_SPI_SCK PA1
194+
#endif
195+
196+
// I2C definitions
197+
#ifndef PIN_WIRE_SDA
198+
#define PIN_WIRE_SDA PA6
199+
#endif
200+
#ifndef PIN_WIRE_SCL
201+
#define PIN_WIRE_SCL PA7
202+
#endif
203+
204+
// Timer Definitions
205+
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
206+
#ifndef TIMER_TONE
207+
#define TIMER_TONE TIM6
208+
#endif
209+
#ifndef TIMER_SERVO
210+
#define TIMER_SERVO TIM7
211+
#endif
212+
213+
// UART Definitions
214+
#ifndef SERIAL_UART_INSTANCE
215+
#define SERIAL_UART_INSTANCE 4
216+
#endif
217+
218+
// Default pin used for generic 'Serial' instance
219+
// Mandatory for Firmata
220+
#ifndef PIN_SERIAL_RX
221+
#define PIN_SERIAL_RX PA1
222+
#endif
223+
#ifndef PIN_SERIAL_TX
224+
#define PIN_SERIAL_TX PA0
225+
#endif
226+
227+
// Extra HAL modules
228+
#if !defined(HAL_DAC_MODULE_DISABLED)
229+
#define HAL_DAC_MODULE_ENABLED
230+
#endif
231+
232+
/*----------------------------------------------------------------------------
233+
* Arduino objects - C++ only
234+
*----------------------------------------------------------------------------*/
235+
236+
#ifdef __cplusplus
237+
// These serial port names are intended to allow libraries and architecture-neutral
238+
// sketches to automatically default to the correct port name for a particular type
239+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
240+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
241+
//
242+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
243+
//
244+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
245+
//
246+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
247+
//
248+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
249+
//
250+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
251+
// pins are NOT connected to anything by default.
252+
#ifndef SERIAL_PORT_MONITOR
253+
#define SERIAL_PORT_MONITOR Serial
254+
#endif
255+
#ifndef SERIAL_PORT_HARDWARE
256+
#define SERIAL_PORT_HARDWARE Serial
257+
#endif
258+
#endif

‎ini/stm32g0.ini

+32-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ upload_protocol = stlink
4141
debug_tool = stlink
4242

4343
#
44-
# BigTreeTech SKR mini E3 V3.0 (STM32G0B1RET6 ARM Cortex-M0+)
44+
# BigTreeTech SKR Mini E3 V3.0 / Manta E3 EZ V1.0 / Manta M4P V1.0 / Manta M5P V1.0 (STM32G0B1RET6 ARM Cortex-M0+)
4545
#
4646
[env:STM32G0B1RE_btt]
4747
extends = stm32_variant
@@ -59,6 +59,7 @@ upload_protocol = stlink
5959
debug_tool = stlink
6060

6161
#
62+
# BigTreeTech SKR Mini E3 V3.0 / Manta E3 EZ V1.0 / Manta M4P V1.0 / Manta M5P V1.0 (STM32G0B1RET6 ARM Cortex-M0+)
6263
# Custom upload to SD via Marlin with Binary Protocol
6364
#
6465
[env:STM32G0B1RE_btt_xfer]
@@ -67,3 +68,33 @@ build_flags = ${env:STM32G0B1RE_btt.build_flags} -DXFER_BUILD
6768
extra_scripts = ${env:STM32G0B1RE_btt.extra_scripts}
6869
pre:buildroot/share/scripts/upload.py
6970
upload_protocol = custom
71+
72+
#
73+
# BigTreeTech Manta M8P V1.x (STM32G0B1VET6 ARM Cortex-M0+)
74+
#
75+
[env:STM32G0B1VE_btt]
76+
extends = stm32_variant
77+
platform = ststm32@~14.1.0
78+
platform_packages = framework-arduinoststm32@https://github.com/stm32duino/Arduino_Core_STM32/archive/main.zip
79+
board = marlin_STM32G0B1VE
80+
board_build.offset = 0x2000
81+
board_upload.offset_address = 0x08002000
82+
build_flags = ${stm32_variant.build_flags}
83+
-DPIN_SERIAL4_RX=PE_9 -DPIN_SERIAL4_TX=PE_8
84+
-DPIN_SERIAL5_RX=PE_11 -DPIN_SERIAL5_TX=PE_10
85+
-DSERIAL_RX_BUFFER_SIZE=1024 -DSERIAL_TX_BUFFER_SIZE=1024
86+
-DTIMER_SERVO=TIM3 -DTIMER_TONE=TIM4
87+
-DSTEP_TIMER_IRQ_PRIO=0
88+
upload_protocol = stlink
89+
debug_tool = stlink
90+
91+
#
92+
# BigTreeTech Manta M8P V1.x (STM32G0B1VET6 ARM Cortex-M0+)
93+
# Custom upload to SD via Marlin with Binary Protocol
94+
#
95+
[env:STM32G0B1VE_btt_xfer]
96+
extends = env:STM32G0B1VE_btt
97+
build_flags = ${env:STM32G0B1VE_btt.build_flags} -DXFER_BUILD
98+
extra_scripts = ${env:STM32G0B1VE_btt.extra_scripts}
99+
pre:buildroot/share/scripts/upload.py
100+
upload_protocol = custom

0 commit comments

Comments
 (0)
Please sign in to comment.