Skip to content

Commit 1972074

Browse files
committed
✨ Prusa Buddy
Completes #28439
1 parent 5107688 commit 1972074

6 files changed

Lines changed: 330 additions & 0 deletions

File tree

Marlin/src/core/boards.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,6 +496,8 @@
496496
#define BOARD_ZNP_ROBIN_NANO_V1_3 5260 // Elegoo Neptune 2 v1.3 board
497497
#define BOARD_MKS_NEPTUNE_X 5261 // Elegoo Neptune X
498498
#define BOARD_MKS_NEPTUNE_3 5262 // Elegoo Neptune 3
499+
#define BOARD_PRUSA_BUDDY 5263 // Prusa Buddy Board Mini (STM32F407VGT6)
500+
#define BOARD_PRUSA_BUDDY_XL 5264 // Prusa xBuddy Board (STM32F407VGT6)
499501

500502
//
501503
// Other ARM Cortex-M4

Marlin/src/pins/pins.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -828,6 +828,10 @@
828828
#include "stm32f4/pins_MKS_NEPTUNE_X.h" // STM32F4 env:mks_neptune_x
829829
#elif MB(MKS_NEPTUNE_3)
830830
#include "stm32f4/pins_MKS_NEPTUNE_3.h" // STM32F4 env:mks_neptune_3
831+
#elif MB(PRUSA_BUDDY)
832+
#include "stm32f4/pins_PRUSA_BUDDY.h" // STM32F4 env:STM32F407VG_prusa_buddy env:STM32F407VG_prusa_buddy_USB
833+
#elif MB(PRUSA_BUDDY_XL)
834+
#include "stm32f4/pins_PRUSA_BUDDY_XL.h" // STM32F4 env:STM32F407VG_prusa_buddy env:STM32F407VG_prusa_buddy_USB
831835

832836
//
833837
// Other ARM Cortex-M4
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2026 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+
23+
/**
24+
* pins_PRUSA_BUDDY.h
25+
* Prusa Buddy Board Mini pin definitions
26+
*
27+
* Prusa Buddy Board Mini (Prusa Mini / Mini+)
28+
* MCU: STM32F407VGT6 (STM32F407VG, 100-pin LQFP)
29+
*
30+
* Schematic: https://github.com/prusa3d/Buddy-board-MINI-PCB
31+
*/
32+
33+
#pragma once
34+
35+
#define BOARD_INFO_NAME "Prusa Buddy"
36+
#define DEFAULT_MACHINE_NAME "Prusa Mini"
37+
38+
#include "pins_PRUSA_BUDDY_common.h"
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2026 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+
23+
/**
24+
* pins_PRUSA_BUDDY_XL.h
25+
* Prusa xBuddy Board pin definitions
26+
*
27+
* Board: Prusa xBuddy Board
28+
* MCU: STM32F407VGT6 (STM32F407VG, 100-pin LQFP)
29+
*
30+
* The xBuddy shares the base pinout with the Buddy Mini.
31+
* This file includes the common definitions and adds xBuddy-specific overrides.
32+
*
33+
* Schematic: https://github.com/prusa3d/Buddy-board-MINI-PCB
34+
*/
35+
36+
#pragma once
37+
38+
#define BOARD_INFO_NAME "Prusa xBuddy"
39+
#define DEFAULT_MACHINE_NAME "Prusa xBuddy"
40+
41+
// xBuddy uses the same base pinout as Buddy Mini
42+
#include "pins_PRUSA_BUDDY_common.h"
43+
44+
//
45+
// xBuddy-specific overrides (if any) go below
46+
//
47+
// Note: If xBuddy has differences such as a different display connector,
48+
// additional stepper drivers, or different peripheral routing, define
49+
// them here to override the common definitions.
Lines changed: 214 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,214 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2026 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+
23+
/**
24+
* pins_PRUSA_BUDDY_common.h
25+
* Prusa Buddy Board common pin definitions
26+
*
27+
* This common file is shared by Buddy Mini and xBuddy board variants.
28+
*
29+
* MCU: STM32F407VGT6 (STM32F407VG, 100-pin LQFP)
30+
* Schematic: https://github.com/prusa3d/Buddy-board-MINI-PCB
31+
*/
32+
33+
#pragma once
34+
35+
#include "env_validate.h"
36+
37+
//
38+
// EEPROM
39+
//
40+
#if NO_EEPROM_SELECTED
41+
#define FLASH_EEPROM_EMULATION
42+
#endif
43+
#if ENABLED(FLASH_EEPROM_EMULATION)
44+
#define FLASH_EEPROM_LEVELING
45+
#endif
46+
47+
//
48+
// Servo pin
49+
//
50+
#define SERVO0_PIN PE14
51+
52+
//
53+
// Trinamic Stallguard / Diag pins
54+
// (Using the UART-based TMC2209 on this board, so diag pins used for endstops)
55+
//
56+
#define X_STOP_PIN PG3
57+
#define Y_STOP_PIN PG4
58+
#define Z_STOP_PIN PG5
59+
60+
//
61+
// Z Probe (when not Z_MIN_PIN)
62+
//
63+
#ifndef Z_MIN_PROBE_PIN
64+
#define Z_MIN_PROBE_PIN PG6
65+
#endif
66+
67+
//
68+
// Filament Runout
69+
//
70+
#define FIL_RUNOUT_PIN PE5
71+
#define FIL_RUNOUT2_PIN PE6
72+
73+
//
74+
// Steppers
75+
//
76+
#define X_STEP_PIN PG1
77+
#define X_DIR_PIN PB10
78+
#define X_ENABLE_PIN PG0
79+
80+
#define Y_STEP_PIN PF14
81+
#define Y_DIR_PIN PF15
82+
#define Y_ENABLE_PIN PF13
83+
84+
#define Z_STEP_PIN PF11
85+
#define Z_DIR_PIN PF12
86+
#define Z_ENABLE_PIN PC5
87+
88+
#define E0_STEP_PIN PC14
89+
#define E0_DIR_PIN PC13
90+
#define E0_ENABLE_PIN PC15
91+
92+
//
93+
// TMC2209 UART Stepper Drivers
94+
//
95+
#if HAS_TMC_UART
96+
#ifndef X_SERIAL_TX_PIN
97+
#define X_SERIAL_TX_PIN PB2
98+
#endif
99+
#ifndef Y_SERIAL_TX_PIN
100+
#define Y_SERIAL_TX_PIN PE2
101+
#endif
102+
#ifndef Z_SERIAL_TX_PIN
103+
#define Z_SERIAL_TX_PIN PE3
104+
#endif
105+
#ifndef E0_SERIAL_TX_PIN
106+
#define E0_SERIAL_TX_PIN PE4
107+
#endif
108+
109+
// Reduce baud rate to improve software serial reliability
110+
#ifndef TMC_BAUD_RATE
111+
#define TMC_BAUD_RATE 19200
112+
#endif
113+
#endif
114+
115+
//
116+
// UART connector (J7) - USART3 via alternate pins
117+
// PB10 is already used for X_DIR_PIN, so use alternate USART3 pins
118+
//
119+
#define BOARD_UART_TX_PIN PD8 // USART3_TX (alternate)
120+
#define BOARD_UART_RX_PIN PD9 // USART3_RX (alternate)
121+
122+
//
123+
// Temperature Sensors
124+
//
125+
// TODO: Upstream Prusa firmware marks these as "Dummy, measured by puppy"
126+
// — indicating external measurement via a separate controller/daughter-board.
127+
// Verify whether local ADC reads are valid or if values come over I2C/CAN.
128+
//
129+
#define TEMP_0_PIN PC1 // Analog Input - THERM0 (Nozzle)
130+
#define TEMP_1_PIN PC2 // Analog Input - THERM1
131+
#define TEMP_BED_PIN PC0 // Analog Input - BED_THERM
132+
133+
//
134+
// Heaters / Fans
135+
//
136+
// TODO: Upstream Prusa firmware marks HEATER_0 and HEATER_BED as
137+
// "Dummy, measured by puppy" — heater PWM may be driven externally.
138+
//
139+
#define HEATER_0_PIN PA1
140+
#define HEATER_BED_PIN PA2
141+
142+
// TODO: Upstream Prusa firmware has "#undef E0_AUTO_FAN_PIN" with the note
143+
// "no auto fan pin - handled by dwarf". The "dwarf" appears to be a
144+
// daughter-board or CANbus peripheral that manages fan control.
145+
// Investigate dwarf interface before enabling AUTO_FAN here.
146+
//
147+
#ifndef FAN0_PIN
148+
#define FAN0_PIN PF7
149+
#endif
150+
#define FAN1_PIN PF6
151+
152+
//
153+
// Misc. Functions
154+
//
155+
#define PS_ON_PIN PA4
156+
#define POWER_LOSS_PIN PA4 // Power-loss / nAC_FAULT
157+
158+
//
159+
// SD Card - SDIO
160+
//
161+
#define ONBOARD_SDIO
162+
#define SD_DETECT_PIN PA8
163+
164+
//
165+
// NeoPixel / LED
166+
//
167+
#define LED_PIN PA15 // Status LED
168+
169+
//
170+
// I2C (ESP32 WiFi module on level converter)
171+
//
172+
#define I2C_SCL_PIN PB6
173+
#define I2C_SDA_PIN PB7
174+
175+
//
176+
// SPI Flash (onboard W25Q128 via SPI1)
177+
//
178+
#define SPI_FLASH
179+
#if ENABLED(SPI_FLASH)
180+
#define SPI_DEVICE 1 // SPI1
181+
#define SPI_FLASH_SIZE 0x1000000 // 16MB
182+
// SPI1 pins: PA5=SCK, PA6=MISO, PA7=MOSI
183+
#if !PIN_EXISTS(PS_ON)
184+
#define SPI_FLASH_CS_PIN PA4 // Flash CS (shares PS_ON_PIN - mutually exclusive)
185+
#endif
186+
#define SPI_FLASH_SCK_PIN PA5
187+
#define SPI_FLASH_MISO_PIN PA6
188+
#define SPI_FLASH_MOSI_PIN PA7
189+
#endif
190+
191+
//
192+
// Ethernet (LAN8742A RMII)
193+
//
194+
#if HAS_ETHERNET
195+
#ifndef ETH_PHY_TYPE
196+
#define ETH_PHY_TYPE LAN8742A
197+
#define ETH_PHY_ADDR 1
198+
#endif
199+
// EPHY_RST via level converter - use PF2 (free GPIO, not conflicting with TMC serial)
200+
#define ETH_RESET_PIN PF2
201+
#endif
202+
203+
//
204+
// LCD / Controller (EXP1/EXP2 connectors)
205+
//
206+
#if IS_NEWPANEL
207+
#define BEEPER_PIN PC7
208+
#define BTN_EN1 PG11
209+
#define BTN_EN2 PG10
210+
#define BTN_ENC PG9
211+
#ifndef ENCODER_STEPS_PER_MENU_ITEM
212+
#define ENCODER_STEPS_PER_MENU_ITEM 2
213+
#endif
214+
#endif

ini/stm32f4.ini

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,29 @@ extends = env:STM32F407VG_btt_USB
322322
build_flags = ${env:STM32F407VG_btt_USB.build_flags} -O0
323323
build_unflags = ${env:STM32F407VG_btt_USB.build_unflags} -Os -DNDEBUG
324324

325+
#
326+
# Prusa Buddy Board Mini (STM32F407VGT6 ARM Cortex-M4)
327+
#
328+
[env:STM32F407VG_prusa_buddy]
329+
extends = stm32_variant
330+
platform_packages = ${stm_flash_drive.platform_packages}
331+
board = marlin_STM32F407VGT6_CCM
332+
board_build.variant = MARLIN_F4x7Vx
333+
board_build.offset = 0x8000
334+
board_upload.offset_address = 0x08008000
335+
build_flags = ${stm32_variant.build_flags} ${stm_flash_drive.build_flags} ${USB_HS_IN_FS.build_flags}
336+
-DHSE_VALUE=8000000U -DHAL_SD_MODULE_ENABLED
337+
-DPIN_SERIAL3_RX=PD_9 -DPIN_SERIAL3_TX=PD_8
338+
upload_protocol = stlink
339+
340+
#
341+
# Prusa Buddy Board Mini (STM32F407VGT6 ARM Cortex-M4) with USB Media Share Support
342+
#
343+
[env:STM32F407VG_prusa_buddy_USB]
344+
extends = env:STM32F407VG_prusa_buddy
345+
build_flags = ${env:STM32F407VG_prusa_buddy.build_flags} -DUSBD_USE_CDC_MSC
346+
build_unflags = ${env:STM32F407VG_prusa_buddy.build_unflags} -DUSBD_USE_CDC
347+
325348
#
326349
# Bigtreetech SKR V2.0 (STM32F429VGT6 ARM Cortex-M4) with USB Flash Drive Support
327350
#

0 commit comments

Comments
 (0)