Skip to content

Commit 485fb77

Browse files
ellenspthinkyhead
authored andcommitted
✨ Tronxy v10 (MarlinFirmware#24787)
1 parent 2929400 commit 485fb77

File tree

13 files changed

+1970
-1
lines changed

13 files changed

+1970
-1
lines changed

Marlin/Configuration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3059,7 +3059,7 @@
30593059
//#define MKS_ROBIN_TFT_V1_1R
30603060

30613061
//
3062-
// 480x320, 3.5", FSMC Stock Display from TronxXY
3062+
// 480x320, 3.5", FSMC Stock Display from Tronxy
30633063
//
30643064
//#define TFT_TRONXY_X5SA
30653065

Marlin/src/core/boards.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@
426426
#define BOARD_OPULO_LUMEN_REV4 4241 // Opulo Lumen PnP Controller REV4 (STM32F407VE / STM32F407VG)
427427
#define BOARD_FYSETC_SPIDER_KING407 4242 // FYSETC Spider King407 (STM32F407ZG)
428428
#define BOARD_MKS_SKIPR_V1 4243 // MKS SKIPR v1.0 all-in-one board (STM32F407VE)
429+
#define BOARD_TRONXY_V10 4244 // TRONXY V10 (STM32F446ZE)
429430

430431
//
431432
// ARM Cortex M7

Marlin/src/pins/pins.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,8 @@
711711
#include "stm32f4/pins_FYSETC_SPIDER_KING407.h" // STM32F4 env:FYSETC_SPIDER_KING407
712712
#elif MB(MKS_SKIPR_V1)
713713
#include "stm32f4/pins_MKS_SKIPR_V1_0.h" // STM32F4 env:mks_skipr_v1 env:mks_skipr_v1_nobootloader
714+
#elif MB(TRONXY_V10)
715+
#include "stm32f4/pins_TRONXY_V10.h" // STM32F4 env:STM32F446_tronxy
714716

715717
//
716718
// ARM Cortex M7

Marlin/src/pins/stm32f4/pins_TH3D_EZBOARD_V2.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
#define ALLOW_STM32DUINO
2525
#include "env_validate.h"
2626

27+
#if HOTENDS > 1 || E_STEPPERS > 1
28+
#error "TH3D EZBoard only supports 1 hotend / E stepper."
29+
#endif
30+
2731
#define BOARD_INFO_NAME "TH3D EZBoard V2"
2832
#define BOARD_WEBSITE_URL "th3dstudio.com"
2933

Lines changed: 266 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,266 @@
1+
/**
2+
* Marlin 3D Printer Firmware
3+
* Copyright (c) 2022 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+
#if HOTENDS > 3 || E_STEPPERS > 3
27+
#error "Tronxy V10 supports up to 3 hotends / E steppers."
28+
#endif
29+
30+
#define BOARD_INFO_NAME "Tronxy V10"
31+
#define DEFAULT_MACHINE_NAME BOARD_INFO_NAME
32+
33+
#define STEP_TIMER 6
34+
#define TEMP_TIMER 14
35+
36+
//
37+
// Servos
38+
//
39+
//#define SERVO0_PIN PB10
40+
41+
//
42+
// EEPROM
43+
//
44+
#if NO_EEPROM_SELECTED
45+
#undef NO_EEPROM_SELECTED
46+
#if TRONXY_UI > 0
47+
#define EEPROM_AT24CXX
48+
#else
49+
#define FLASH_EEPROM_EMULATION
50+
#endif
51+
#endif
52+
53+
#if ENABLED(FLASH_EEPROM_EMULATION)
54+
// SoC Flash (framework-arduinoststm32-maple/STM32F1/libraries/EEPROM/EEPROM.h)
55+
#define EEPROM_START_ADDRESS (0x8000000UL + (512 * 1024) - 2 * EEPROM_PAGE_SIZE)
56+
#define EEPROM_PAGE_SIZE (0x800U) // 2KB, but will use 2x more (4KB)
57+
#define MARLIN_EEPROM_SIZE EEPROM_PAGE_SIZE
58+
#else
59+
#if ENABLED(EEPROM_AT24CXX)
60+
#define AT24CXX_SCL PB8
61+
#define AT24CXX_SDA PB9
62+
#define AT24CXX_WP PB7
63+
#else
64+
#define I2C_EEPROM // AT24C32
65+
#endif
66+
#define MARLIN_EEPROM_SIZE 0x1000 // 4K
67+
#endif
68+
69+
//
70+
// SPI Flash
71+
//
72+
//#define SPI_FLASH
73+
#if ENABLED(SPI_FLASH)
74+
#define SPI_FLASH_SIZE 0x200000 // 2MB
75+
#define W25QXX_CS_PIN PG15 // SPI2
76+
#define W25QXX_MOSI_PIN PB5
77+
#define W25QXX_MISO_PIN PB4
78+
#define W25QXX_SCK_PIN PB3
79+
#endif
80+
81+
//
82+
// Limit Switches
83+
//
84+
#define X_MIN_PIN PC15
85+
#define X_MAX_PIN PB0
86+
#define Y_STOP_PIN PC14
87+
88+
#ifndef Z_MIN_PROBE_PIN
89+
#define Z_MIN_PROBE_PIN PE3
90+
#endif
91+
92+
#if ENABLED(DUAL_Z_ENDSTOP_PROBE)
93+
#if NUM_Z_STEPPERS > 1 && Z_HOME_TO_MAX // Swap Z1/Z2 for dual Z with max homing
94+
#define Z_MIN_PIN PF11
95+
#define Z_MAX_PIN PC13
96+
#else
97+
#define Z_MIN_PIN PC13
98+
#define Z_MAX_PIN PF11
99+
#endif
100+
#else
101+
#ifndef Z_STOP_PIN
102+
#define Z_STOP_PIN PC13
103+
#endif
104+
#endif
105+
//
106+
// Filament Sensors
107+
//
108+
#ifndef FIL_RUNOUT_PIN
109+
#define FIL_RUNOUT_PIN PE6 // MT_DET
110+
#endif
111+
#ifndef FIL_RUNOUT2_PIN
112+
#define FIL_RUNOUT2_PIN PF12
113+
#endif
114+
115+
//
116+
// Steppers
117+
//
118+
#define X_ENABLE_PIN PF0
119+
#define X_STEP_PIN PE5
120+
#define X_DIR_PIN PF1
121+
122+
#define Y_ENABLE_PIN PF5
123+
#define Y_STEP_PIN PF9
124+
#define Y_DIR_PIN PF3
125+
126+
#define Z_ENABLE_PIN PA5
127+
#define Z_STEP_PIN PA6
128+
#define Z_DIR_PIN PF15
129+
130+
#define E0_ENABLE_PIN PF14
131+
#define E0_STEP_PIN PB1
132+
#define E0_DIR_PIN PF13
133+
134+
#define E1_ENABLE_PIN PG5
135+
#define E1_STEP_PIN PD12
136+
#define E1_DIR_PIN PG4
137+
138+
#define E2_ENABLE_PIN PF7
139+
#define E2_STEP_PIN PF6
140+
#define E2_DIR_PIN PF4
141+
142+
//
143+
// Temperature Sensors
144+
//
145+
#define TEMP_0_PIN PC3 // TH1
146+
#define TEMP_BED_PIN PC2 // TB1
147+
148+
//
149+
// Heaters / Fans
150+
//
151+
#define HEATER_0_PIN PG7 // HEATER1
152+
#define HEATER_BED_PIN PE2 // HOT BED
153+
//#define HEATER_BED_INVERTING true
154+
155+
#define FAN_PIN PG0 // FAN0
156+
#define FAN1_PIN PB6 // FAN1
157+
#define FAN2_PIN PG9 // FAN2
158+
#define FAN3_PIN PF10 // FAN3
159+
#define CONTROLLER_FAN_PIN PD7 // BOARD FAN
160+
#define FAN_SOFT_PWM
161+
162+
//
163+
// Laser / Spindle
164+
//
165+
#if HAS_CUTTER
166+
#define SPINDLE_LASER_ENA_PIN PB11 // wifi:TX
167+
#if ENABLED(SPINDLE_LASER_USE_PWM)
168+
#define SPINDLE_LASER_PWM_PIN PB10 // wifi:RX-TIM2_CH3
169+
// The PWM pin definition const PinMap PinMap_PWM[] in PeripheralPins.c must be compounded here
170+
// See PWM_PIN(x) definition for details
171+
#endif
172+
#endif
173+
174+
//
175+
// Misc
176+
//
177+
#define BEEPER_PIN PA8
178+
179+
//#define LED_PIN PG10
180+
#define PS_ON_PIN PG10 // Temporarily switch the machine with LED simulation
181+
182+
#if ENABLED(TRONXY_BACKUP_POWER)
183+
#define POWER_LOSS_PIN PF11 // Configure as drop-down input
184+
#else
185+
#define POWER_LOSS_PIN PE1 // Output of LM393 comparator, configured as pullup
186+
#endif
187+
//#define POWER_LM393_PIN PE0 // +V for the LM393 comparator, configured as output high
188+
189+
#if ENABLED(TFT_TRONXY_X5SA)
190+
#error "TFT_TRONXY_X5SA is not yet supported."
191+
#endif
192+
193+
#if 0
194+
195+
//
196+
// TFT with FSMC interface
197+
//
198+
#if HAS_FSMC_TFT
199+
#define TFT_RESET_PIN PB12
200+
#define TFT_BACKLIGHT_PIN PG8
201+
202+
#define LCD_USE_DMA_FSMC // Use DMA transfers to send data to the TFT
203+
#define FSMC_DMA_DEV DMA2
204+
#define FSMC_DMA_CHANNEL DMA_CH5
205+
206+
#define TFT_CS_PIN PG12
207+
#define TFT_RS_PIN PG2
208+
209+
//#define TFT_WIDTH 480
210+
//#define TFT_HEIGHT 320
211+
//#define TFT_PIXEL_OFFSET_X 48
212+
//#define TFT_PIXEL_OFFSET_Y 32
213+
//#define TFT_DRIVER ILI9488
214+
//#define TFT_BUFFER_SIZE 14400
215+
216+
#if NEED_TOUCH_PINS
217+
#define TOUCH_CS_PIN PD11 // SPI1_NSS
218+
#define TOUCH_SCK_PIN PB13 // SPI1_SCK
219+
#define TOUCH_MISO_PIN PB14 // SPI1_MISO
220+
#define TOUCH_MOSI_PIN PB15 // SPI1_MOSI
221+
#endif
222+
223+
#if (LCD_CHIP_INDEX == 1 && (TRONXY_UI == 1 || TRONXY_UI == 2)) || LCD_CHIP_INDEX == 3
224+
#define TOUCH_CALIBRATION_X -17181
225+
#define TOUCH_CALIBRATION_Y 11434
226+
#define TOUCH_OFFSET_X 501
227+
#define TOUCH_OFFSET_Y -9
228+
#elif LCD_CHIP_INDEX == 1 && TRONXY_UI == 4
229+
#define TOUCH_CALIBRATION_X 11166
230+
#define TOUCH_CALIBRATION_Y 17162
231+
#define TOUCH_OFFSET_X -10
232+
#define TOUCH_OFFSET_Y -16
233+
#elif LCD_CHIP_INDEX == 4 && TRONXY_UI == 3
234+
//#define TOUCH_CALIBRATION_X 8781
235+
//#define TOUCH_CALIBRATION_Y 11773
236+
//#define TOUCH_OFFSET_X -17
237+
//#define TOUCH_OFFSET_Y -16
238+
// Upside-down
239+
#define TOUCH_CALIBRATION_X -8553
240+
#define TOUCH_CALIBRATION_Y -11667
241+
#define TOUCH_OFFSET_X 253
242+
#define TOUCH_OFFSET_Y 331
243+
#elif LCD_CHIP_INDEX == 2
244+
#define TOUCH_CALIBRATION_X 17184
245+
#define TOUCH_CALIBRATION_Y 10604
246+
#define TOUCH_OFFSET_X -31
247+
#define TOUCH_OFFSET_Y -29
248+
#endif
249+
#endif
250+
251+
#endif
252+
253+
//
254+
// SD Card
255+
//
256+
#define SDIO_SUPPORT
257+
#define SD_DETECT_PIN -1 // PF0, but not connected
258+
#define SDIO_CLOCK 4500000
259+
#define SDIO_READ_RETRIES 16
260+
261+
#define SDIO_D0_PIN PC8
262+
#define SDIO_D1_PIN PC9
263+
#define SDIO_D2_PIN PC10
264+
#define SDIO_D3_PIN PC11
265+
#define SDIO_CK_PIN PC12
266+
#define SDIO_CMD_PIN PD2
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"build": {
3+
"cpu": "cortex-m4",
4+
"extra_flags": "-DSTM32F446xx",
5+
"f_cpu": "180000000L",
6+
"mcu": "stm32f446zet6",
7+
"variant": "MARLIN_F446Zx_TRONXY"
8+
},
9+
"connectivity": [
10+
"can"
11+
],
12+
"debug": {
13+
"jlink_device": "STM32F446ZE",
14+
"openocd_target": "stm32f4x",
15+
"svd_path": "STM32F446x.svd"
16+
},
17+
"frameworks": [
18+
"arduino",
19+
"stm32cube"
20+
],
21+
"name": "STM32F446ZE (128k RAM. 512k Flash)",
22+
"upload": {
23+
"maximum_ram_size": 131072,
24+
"maximum_size": 524288,
25+
"protocol": "stlink",
26+
"protocols": [
27+
"jlink",
28+
"stlink",
29+
"blackmagic",
30+
"serial"
31+
]
32+
},
33+
"url": "https://www.st.com/en/microcontrollers-microprocessors/stm32f446.html",
34+
"vendor": "Generic"
35+
}

0 commit comments

Comments
 (0)