Просмотр исходного кода

✨ MKS Eagle (STM32F407VET6) board (#22897)

mks-viva 3 лет назад
Родитель
Сommit
a7519ecca9
Аккаунт пользователя с таким Email не найден

+ 1
- 0
Marlin/src/core/boards.h Просмотреть файл

@@ -402,6 +402,7 @@
402 402
 #define BOARD_TH3D_EZBOARD_LITE_V2    4232  // TH3D EZBoard Lite v2.0
403 403
 #define BOARD_INDEX_REV03             4233  // Index PnP Controller REV03 (STM32F407VET6/VGT6)
404 404
 #define BOARD_MKS_ROBIN_NANO_V1_3_F4  4234  // MKS Robin Nano V1.3 and MKS Robin Nano-S V1.3 (STM32F407VET6)
405
+#define BOARD_MKS_EAGLE               4235  // MKS Eagle (STM32F407VET6)
405 406
 
406 407
 //
407 408
 // ARM Cortex M7

+ 2
- 0
Marlin/src/pins/pins.h Просмотреть файл

@@ -651,6 +651,8 @@
651 651
   #include "stm32f4/pins_INDEX_REV03.h"         // STM32F4                                env:Index_Mobo_Rev03
652 652
 #elif MB(MKS_ROBIN_NANO_V1_3_F4)
653 653
   #include "stm32f4/pins_MKS_ROBIN_NANO_V1_3_F4.h" // STM32F4                             env:mks_robin_nano_v1_3_f4
654
+#elif MB(MKS_EAGLE)
655
+  #include "stm32f4/pins_MKS_EAGLE.h"           // STM32F4                                env:mks_eagle
654 656
 
655 657
 //
656 658
 // ARM Cortex M7

+ 35
- 0
Marlin/src/pins/stm32f4/pins_MKS_EAGLE.h Просмотреть файл

@@ -0,0 +1,35 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2021 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
+#define ALLOW_STM32DUINO
25
+#include "env_validate.h"
26
+
27
+#if HOTENDS > 2 || E_STEPPERS > 2
28
+  #error "MKS Eagle supports up to 2 hotends / E-steppers."
29
+#elif HAS_FSMC_TFT
30
+  #error "MKS Eagle doesn't support FSMC-based TFT displays."
31
+#endif
32
+
33
+#define BOARD_INFO_NAME "MKS Eagle"
34
+
35
+#include "pins_MKS_ROBIN_NANO_V3_common.h"

+ 1
- 342
Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3.h Просмотреть файл

@@ -32,80 +32,22 @@
32 32
 
33 33
 #define BOARD_INFO_NAME "MKS Robin Nano V3"
34 34
 
35
-// USB Flash Drive support
36
-#define HAS_OTG_USB_HOST_SUPPORT
37
-
38
-// Avoid conflict with TIMER_TONE
39
-#define STEP_TIMER                            10
40
-
41
-// Use one of these or SDCard-based Emulation will be used
42
-//#define SRAM_EEPROM_EMULATION                   // Use BackSRAM-based EEPROM emulation
43
-//#define FLASH_EEPROM_EMULATION                  // Use Flash-based EEPROM emulation
44
-#if EITHER(NO_EEPROM_SELECTED, I2C_EEPROM)
45
-  #define I2C_EEPROM
46
-  #define MARLIN_EEPROM_SIZE              0x1000  // 4KB
47
-  #define I2C_SCL_PIN                       PB6
48
-  #define I2C_SDA_PIN                       PB7
49
-#endif
50
-
51
-//
52
-// Release PB4 (Z_DIR_PIN) from JTAG NRST role
53
-//
54
-//#define DISABLE_DEBUG
55
-
56
-//
57
-// Servos
58
-//
59
-#define SERVO0_PIN                          PA8   // Enable BLTOUCH
60
-
61
-//
62
-// Limit Switches
63
-//
64
-#define X_DIAG_PIN                          PA15
65
-#define Y_DIAG_PIN                          PD2
66
-#define Z_DIAG_PIN                          PC8
67
-#define E0_DIAG_PIN                         PC4
68
-#define E1_DIAG_PIN                         PE7
69
-
70
-#define X_STOP_PIN                    X_DIAG_PIN
71
-#define Y_STOP_PIN                    Y_DIAG_PIN
72
-#define Z_MIN_PIN                     Z_DIAG_PIN
73
-#define Z_MAX_PIN                    E0_DIAG_PIN
74
-
75
-//
76
-// Steppers
77
-//
78
-#define X_ENABLE_PIN                        PE4
79
-#define X_STEP_PIN                          PE3
80
-#define X_DIR_PIN                           PE2
81 35
 #ifndef X_CS_PIN
82 36
   #define X_CS_PIN                          PD5
83 37
 #endif
84 38
 
85
-#define Y_ENABLE_PIN                        PE1
86
-#define Y_STEP_PIN                          PE0
87
-#define Y_DIR_PIN                           PB9
88 39
 #ifndef Y_CS_PIN
89 40
   #define Y_CS_PIN                          PD7
90 41
 #endif
91 42
 
92
-#define Z_ENABLE_PIN                        PB8
93
-#define Z_STEP_PIN                          PB5
94
-#define Z_DIR_PIN                           PB4
95 43
 #ifndef Z_CS_PIN
96 44
   #define Z_CS_PIN                          PD4
97 45
 #endif
98 46
 
99
-#define E0_ENABLE_PIN                       PB3
100
-#define E0_STEP_PIN                         PD6
101
-#define E0_DIR_PIN                          PD3
102 47
 #ifndef E0_CS_PIN
103 48
   #define E0_CS_PIN                         PD9
104 49
 #endif
105 50
 
106
-#define E1_ENABLE_PIN                       PA3
107
-#define E1_STEP_PIN                         PD15
108
-#define E1_DIR_PIN                          PA1
109 51
 #ifndef E1_CS_PIN
110 52
   #define E1_CS_PIN                         PD8
111 53
 #endif
@@ -129,287 +71,4 @@
129 71
   #endif
130 72
 #endif
131 73
 
132
-#if HAS_TMC_UART
133
-  //
134
-  // Software serial
135
-  // No Hardware serial for steppers
136
-  //
137
-  #define X_SERIAL_TX_PIN                   PD5
138
-  #define X_SERIAL_RX_PIN        X_SERIAL_TX_PIN
139
-
140
-  #define Y_SERIAL_TX_PIN                   PD7
141
-  #define Y_SERIAL_RX_PIN        Y_SERIAL_TX_PIN
142
-
143
-  #define Z_SERIAL_TX_PIN                   PD4
144
-  #define Z_SERIAL_RX_PIN        Z_SERIAL_TX_PIN
145
-
146
-  #define E0_SERIAL_TX_PIN                  PD9
147
-  #define E0_SERIAL_RX_PIN      E0_SERIAL_TX_PIN
148
-
149
-  #define E1_SERIAL_TX_PIN                  PD8
150
-  #define E1_SERIAL_RX_PIN      E1_SERIAL_TX_PIN
151
-
152
-  // Reduce baud rate to improve software serial reliability
153
-  #define TMC_BAUD_RATE                    19200
154
-#endif
155
-
156
-//
157
-// Temperature Sensors
158
-//
159
-#define TEMP_0_PIN                          PC1   // TH1
160
-#define TEMP_1_PIN                          PA2   // TH2
161
-#define TEMP_BED_PIN                        PC0   // TB1
162
-
163
-//
164
-// Heaters / Fans
165
-//
166
-#define HEATER_0_PIN                        PE5   // HEATER1
167
-#define HEATER_1_PIN                        PB0   // HEATER2
168
-#define HEATER_BED_PIN                      PA0   // HOT BED
169
-
170
-#define FAN_PIN                             PC14  // FAN
171
-#define FAN1_PIN                            PB1   // FAN1
172
-
173
-//
174
-// Thermocouples
175
-//
176
-//#define TEMP_0_CS_PIN             HEATER_0_PIN  // TC1 - CS1
177
-//#define TEMP_0_CS_PIN             HEATER_1_PIN  // TC2 - CS2
178
-
179
-//
180
-// Misc. Functions
181
-//
182
-#if HAS_TFT_LVGL_UI
183
-  #define MT_DET_1_PIN                      PA4   // MT_DET
184
-  #define MT_DET_2_PIN                      PE6
185
-  #define MT_DET_PIN_STATE                  LOW
186
-#endif
187
-
188
-#ifndef FIL_RUNOUT_PIN
189
-  #define FIL_RUNOUT_PIN            MT_DET_1_PIN
190
-#endif
191
-#ifndef FIL_RUNOUT2_PIN
192
-  #define FIL_RUNOUT2_PIN           MT_DET_2_PIN
193
-#endif
194
-
195
-#ifndef POWER_LOSS_PIN
196
-  #define POWER_LOSS_PIN                    PA13  // PW_DET
197
-#endif
198
-
199
-//#define SUICIDE_PIN                       PB2
200
-//#define LED_PIN                           PB2
201
-//#define KILL_PIN                          PA2
202
-//#define KILL_PIN_STATE                    LOW
203
-
204
-//
205
-// Power Supply Control
206
-//
207
-#if ENABLED(MKS_PWC)
208
-  #if ENABLED(TFT_LVGL_UI)
209
-    #undef PSU_CONTROL
210
-    #undef MKS_PWC
211
-    #define SUICIDE_PIN                     PB2
212
-    #define SUICIDE_PIN_STATE               LOW
213
-  #else
214
-    #define PS_ON_PIN                       PB2   // PW_OFF
215
-  #endif
216
-  #define KILL_PIN                          PA13  // PW_DET
217
-  #define KILL_PIN_STATE                    HIGH
218
-#endif
219
-
220
-// Random Info
221
-#define USB_SERIAL              -1  // USB Serial
222
-#define WIFI_SERIAL              3  // USART3
223
-#define MKS_WIFI_MODULE_SERIAL   1  // USART1
224
-#define MKS_WIFI_MODULE_SPI      2  // SPI2
225
-
226
-#ifndef SDCARD_CONNECTION
227
-  #define SDCARD_CONNECTION              ONBOARD
228
-#endif
229
-
230
-// MKS WIFI MODULE
231
-#if ENABLED(MKS_WIFI_MODULE)
232
-  #define WIFI_IO0_PIN                      PC13
233
-  #define WIFI_IO1_PIN                      PC7
234
-  #define WIFI_RESET_PIN                    PE9
235
-#endif
236
-
237
-// MKS TEST
238
-#if ENABLED(MKS_TEST)
239
-  #define MKS_TEST_POWER_LOSS_PIN           PA13  // PW_DET
240
-  #define MKS_TEST_PS_ON_PIN                PB2   // PW_OFF
241
-#endif
242
-
243
-//
244
-// Onboard SD card
245
-//
246
-// detect pin doesn't work when ONBOARD and NO_SD_HOST_DRIVE disabled
247
-#if SD_CONNECTION_IS(ONBOARD)
248
-  #define ENABLE_SPI3
249
-  #define SD_SS_PIN                         -1
250
-  #define SDSS                              PC9
251
-  #define SD_SCK_PIN                        PC10
252
-  #define SD_MISO_PIN                       PC11
253
-  #define SD_MOSI_PIN                       PC12
254
-  #define SD_DETECT_PIN                     PD12
255
-#endif
256
-
257
-#define SPI_FLASH
258
-#if ENABLED(SPI_FLASH)
259
-  #define HAS_SPI_FLASH                        1
260
-  #define SPI_DEVICE                           2
261
-  #define SPI_FLASH_SIZE               0x1000000
262
-  #define SPI_FLASH_CS_PIN                  PB12
263
-  #define SPI_FLASH_MOSI_PIN                PC3
264
-  #define SPI_FLASH_MISO_PIN                PC2
265
-  #define SPI_FLASH_SCK_PIN                 PB13
266
-#endif
267
-
268
-/**
269
- *                ------                                     ------
270
- * (BEEPER)  PC5 |10  9 | PE13 (BTN_ENC)   (SPI1 MISO)  PA6 |10  9 | PA5  (SPI1 SCK)
271
- * (LCD_EN) PD13 | 8  7 | PC6  (LCD_RS)      (BTN_EN1)  PE8 | 8  7 | PE10 (SPI1 CS)
272
- * (LCD_D4) PE14   6  5 | PE15 (LCD_D5)      (BTN_EN2) PE11   6  5 | PA7  (SPI1 MOSI)
273
- * (LCD_D6) PD11 | 4  3 | PD10 (LCD_D7)      (SPI1_RS) PE12 | 4  3 | RESET
274
- *           GND | 2  1 | 5V                            GND | 2  1 | 3.3V
275
- *                ------                                     ------
276
- *                 EXP1                                       EXP2
277
- */
278
-#define EXP1_03_PIN                         PD10
279
-#define EXP1_04_PIN                         PD11
280
-#define EXP1_05_PIN                         PE15
281
-#define EXP1_06_PIN                         PE14
282
-#define EXP1_07_PIN                         PC6
283
-#define EXP1_08_PIN                         PD13
284
-#define EXP1_09_PIN                         PE13
285
-#define EXP1_10_PIN                         PC5
286
-
287
-#define EXP2_03_PIN                         -1    // RESET
288
-#define EXP2_04_PIN                         PE12
289
-#define EXP2_05_PIN                         PA7
290
-#define EXP2_06_PIN                         PE11
291
-#define EXP2_07_PIN                         PE10
292
-#define EXP2_08_PIN                         PE8
293
-#define EXP2_09_PIN                         PA5
294
-#define EXP2_10_PIN                         PA6
295
-
296
-//
297
-// SPI SD Card
298
-//
299
-#if SD_CONNECTION_IS(LCD)
300
-  #define ENABLE_SPI1
301
-  #define SDSS                       EXP2_07_PIN
302
-  #define SD_SCK_PIN                 EXP2_09_PIN
303
-  #define SD_MISO_PIN                EXP2_10_PIN
304
-  #define SD_MOSI_PIN                EXP2_05_PIN
305
-  #define SD_DETECT_PIN              EXP2_04_PIN
306
-#endif
307
-
308
-//
309
-// LCD / Controller
310
-//
311
-#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI)
312
-  #define TFT_CS_PIN                 EXP1_04_PIN
313
-  #define TFT_SCK_PIN                EXP2_09_PIN
314
-  #define TFT_MISO_PIN               EXP2_10_PIN
315
-  #define TFT_MOSI_PIN               EXP2_05_PIN
316
-  #define TFT_DC_PIN                 EXP1_03_PIN
317
-  #define TFT_RST_PIN                EXP1_07_PIN
318
-  #define TFT_A0_PIN                  TFT_DC_PIN
319
-
320
-  #define TFT_RESET_PIN              EXP1_07_PIN
321
-  #define TFT_BACKLIGHT_PIN          EXP1_08_PIN
322
-
323
-  #define TOUCH_BUTTONS_HW_SPI
324
-  #define TOUCH_BUTTONS_HW_SPI_DEVICE          1
325
-
326
-  #define LCD_BACKLIGHT_PIN          EXP1_08_PIN
327
-  #ifndef TFT_WIDTH
328
-    #define TFT_WIDTH                        480
329
-  #endif
330
-  #ifndef TFT_HEIGHT
331
-    #define TFT_HEIGHT                       320
332
-  #endif
333
-
334
-  #define TOUCH_CS_PIN               EXP1_06_PIN  // SPI1_NSS
335
-  #define TOUCH_SCK_PIN              EXP2_09_PIN  // SPI1_SCK
336
-  #define TOUCH_MISO_PIN             EXP2_10_PIN  // SPI1_MISO
337
-  #define TOUCH_MOSI_PIN             EXP2_05_PIN  // SPI1_MOSI
338
-
339
-  #define LCD_READ_ID                       0xD3
340
-  #define LCD_USE_DMA_SPI
341
-
342
-  #define TFT_BUFFER_SIZE                  14400
343
-
344
-  #ifndef TOUCH_CALIBRATION_X
345
-    #define TOUCH_CALIBRATION_X           -17253
346
-  #endif
347
-  #ifndef TOUCH_CALIBRATION_Y
348
-    #define TOUCH_CALIBRATION_Y            11579
349
-  #endif
350
-  #ifndef TOUCH_OFFSET_X
351
-    #define TOUCH_OFFSET_X                   514
352
-  #endif
353
-  #ifndef TOUCH_OFFSET_Y
354
-    #define TOUCH_OFFSET_Y                   -24
355
-  #endif
356
-  #ifndef TOUCH_ORIENTATION
357
-    #define TOUCH_ORIENTATION    TOUCH_LANDSCAPE
358
-  #endif
359
-
360
-#elif HAS_WIRED_LCD
361
-
362
-  #define LCD_PINS_ENABLE            EXP1_08_PIN
363
-  #define LCD_PINS_RS                EXP1_07_PIN
364
-  #define LCD_BACKLIGHT_PIN                 -1
365
-
366
-  // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor)
367
-  #if ENABLED(MKS_MINI_12864)
368
-    //#define LCD_BACKLIGHT_PIN             -1
369
-    //#define LCD_RESET_PIN                 -1
370
-    #define DOGLCD_A0                EXP1_04_PIN
371
-    #define DOGLCD_CS                EXP1_05_PIN
372
-    //#define DOGLCD_SCK             EXP2_09_PIN
373
-    //#define DOGLCD_MOSI            EXP2_05_PIN
374
-
375
-    // Required for MKS_MINI_12864 with this board
376
-    //#define MKS_LCD12864B
377
-    //#undef SHOW_BOOTSCREEN
378
-
379
-  #elif ENABLED(MKS_MINI_12864_V3)
380
-    #define DOGLCD_CS                EXP1_08_PIN
381
-    #define DOGLCD_A0                EXP1_07_PIN
382
-    #define LCD_PINS_DC                DOGLCD_A0
383
-    #define LCD_BACKLIGHT_PIN               -1
384
-    #define LCD_RESET_PIN            EXP1_06_PIN
385
-    #define NEOPIXEL_PIN             EXP1_05_PIN
386
-    #define DOGLCD_MOSI              EXP2_05_PIN
387
-    #define DOGLCD_SCK               EXP2_09_PIN
388
-    #if SD_CONNECTION_IS(ONBOARD)
389
-      #define FORCE_SOFT_SPI
390
-    #endif
391
-    //#define LCD_SCREEN_ROT_180
392
-
393
-  #else                                           // !MKS_MINI_12864
394
-
395
-    #define LCD_PINS_D4              EXP1_06_PIN
396
-    #if ENABLED(ULTIPANEL)
397
-      #define LCD_PINS_D5            EXP1_05_PIN
398
-      #define LCD_PINS_D6            EXP1_04_PIN
399
-      #define LCD_PINS_D7            EXP1_03_PIN
400
-    #endif
401
-
402
-    #define BOARD_ST7920_DELAY_1              96
403
-    #define BOARD_ST7920_DELAY_2              48
404
-    #define BOARD_ST7920_DELAY_3             600
405
-
406
-  #endif // !MKS_MINI_12864
407
-
408
-#endif // HAS_WIRED_LCD
409
-
410
-#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI, HAS_WIRED_LCD)
411
-  #define BEEPER_PIN                 EXP1_10_PIN
412
-  #define BTN_EN1                    EXP2_08_PIN
413
-  #define BTN_EN2                    EXP2_06_PIN
414
-  #define BTN_ENC                    EXP1_09_PIN
415
-#endif
74
+#include "pins_MKS_ROBIN_NANO_V3_common.h"

+ 375
- 0
Marlin/src/pins/stm32f4/pins_MKS_ROBIN_NANO_V3_common.h Просмотреть файл

@@ -0,0 +1,375 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2021 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
+#pragma once
24
+
25
+//
26
+// MKS Robin Nano V3, MKS Eagle pinmap
27
+//
28
+
29
+// USB Flash Drive support
30
+#define HAS_OTG_USB_HOST_SUPPORT
31
+
32
+// Avoid conflict with TIMER_TONE
33
+#define STEP_TIMER                            10
34
+
35
+// Use one of these or SDCard-based Emulation will be used
36
+//#define SRAM_EEPROM_EMULATION                   // Use BackSRAM-based EEPROM emulation
37
+//#define FLASH_EEPROM_EMULATION                  // Use Flash-based EEPROM emulation
38
+#if EITHER(NO_EEPROM_SELECTED, I2C_EEPROM)
39
+  #define I2C_EEPROM
40
+  #define MARLIN_EEPROM_SIZE              0x1000  // 4KB
41
+  #define I2C_SCL_PIN                       PB6
42
+  #define I2C_SDA_PIN                       PB7
43
+#endif
44
+
45
+//
46
+// Release PB4 (Z_DIR_PIN) from JTAG NRST role
47
+//
48
+//#define DISABLE_DEBUG
49
+
50
+//
51
+// Servos
52
+//
53
+#define SERVO0_PIN                          PA8   // Enable BLTOUCH
54
+
55
+//
56
+// Limit Switches
57
+//
58
+#define X_DIAG_PIN                          PA15
59
+#define Y_DIAG_PIN                          PD2
60
+#define Z_DIAG_PIN                          PC8
61
+#define E0_DIAG_PIN                         PC4
62
+#define E1_DIAG_PIN                         PE7
63
+
64
+#define X_STOP_PIN                    X_DIAG_PIN
65
+#define Y_STOP_PIN                    Y_DIAG_PIN
66
+#define Z_MIN_PIN                     Z_DIAG_PIN
67
+#define Z_MAX_PIN                    E0_DIAG_PIN
68
+
69
+//
70
+// Steppers
71
+//
72
+#define X_ENABLE_PIN                        PE4
73
+#define X_STEP_PIN                          PE3
74
+#define X_DIR_PIN                           PE2
75
+
76
+#define Y_ENABLE_PIN                        PE1
77
+#define Y_STEP_PIN                          PE0
78
+#define Y_DIR_PIN                           PB9
79
+
80
+#define Z_ENABLE_PIN                        PB8
81
+#define Z_STEP_PIN                          PB5
82
+#define Z_DIR_PIN                           PB4
83
+
84
+#define E0_ENABLE_PIN                       PB3
85
+#define E0_STEP_PIN                         PD6
86
+#define E0_DIR_PIN                          PD3
87
+
88
+#define E1_ENABLE_PIN                       PA3
89
+#define E1_STEP_PIN                         PD15
90
+#define E1_DIR_PIN                          PA1
91
+
92
+#if HAS_TMC_UART
93
+  //
94
+  // Software serial
95
+  // No Hardware serial for steppers
96
+  //
97
+  #define X_SERIAL_TX_PIN                   PD5
98
+  #define X_SERIAL_RX_PIN        X_SERIAL_TX_PIN
99
+
100
+  #define Y_SERIAL_TX_PIN                   PD7
101
+  #define Y_SERIAL_RX_PIN        Y_SERIAL_TX_PIN
102
+
103
+  #define Z_SERIAL_TX_PIN                   PD4
104
+  #define Z_SERIAL_RX_PIN        Z_SERIAL_TX_PIN
105
+
106
+  #define E0_SERIAL_TX_PIN                  PD9
107
+  #define E0_SERIAL_RX_PIN      E0_SERIAL_TX_PIN
108
+
109
+  #define E1_SERIAL_TX_PIN                  PD8
110
+  #define E1_SERIAL_RX_PIN      E1_SERIAL_TX_PIN
111
+
112
+  // Reduce baud rate to improve software serial reliability
113
+  #define TMC_BAUD_RATE                    19200
114
+#endif
115
+
116
+//
117
+// Temperature Sensors
118
+//
119
+#define TEMP_0_PIN                          PC1   // TH1
120
+#define TEMP_1_PIN                          PA2   // TH2
121
+#define TEMP_BED_PIN                        PC0   // TB1
122
+
123
+//
124
+// Heaters / Fans
125
+//
126
+#define HEATER_0_PIN                        PE5   // HEATER1
127
+#define HEATER_1_PIN                        PB0   // HEATER2
128
+#define HEATER_BED_PIN                      PA0   // HOT BED
129
+
130
+#define FAN_PIN                             PC14  // FAN
131
+#define FAN1_PIN                            PB1   // FAN1
132
+
133
+//
134
+// Thermocouples
135
+//
136
+//#define TEMP_0_CS_PIN             HEATER_0_PIN  // TC1 - CS1
137
+//#define TEMP_0_CS_PIN             HEATER_1_PIN  // TC2 - CS2
138
+
139
+//
140
+// Misc. Functions
141
+//
142
+#if HAS_TFT_LVGL_UI
143
+  #define MT_DET_1_PIN                      PA4   // MT_DET
144
+  #define MT_DET_2_PIN                      PE6
145
+  #define MT_DET_PIN_STATE                  LOW
146
+#endif
147
+
148
+#ifndef FIL_RUNOUT_PIN
149
+  #define FIL_RUNOUT_PIN            MT_DET_1_PIN
150
+#endif
151
+#ifndef FIL_RUNOUT2_PIN
152
+  #define FIL_RUNOUT2_PIN           MT_DET_2_PIN
153
+#endif
154
+
155
+#ifndef POWER_LOSS_PIN
156
+  #define POWER_LOSS_PIN                    PA13  // PW_DET
157
+#endif
158
+
159
+//#define SUICIDE_PIN                       PB2
160
+//#define LED_PIN                           PB2
161
+//#define KILL_PIN                          PA2
162
+//#define KILL_PIN_STATE                    LOW
163
+
164
+//
165
+// Power Supply Control
166
+//
167
+#if ENABLED(MKS_PWC)
168
+  #if ENABLED(TFT_LVGL_UI)
169
+    #undef PSU_CONTROL
170
+    #undef MKS_PWC
171
+    #define SUICIDE_PIN                     PB2
172
+    #define SUICIDE_PIN_STATE               LOW
173
+  #else
174
+    #define PS_ON_PIN                       PB2   // PW_OFF
175
+  #endif
176
+  #define KILL_PIN                          PA13  // PW_DET
177
+  #define KILL_PIN_STATE                    HIGH
178
+#endif
179
+
180
+// Random Info
181
+#define USB_SERIAL              -1  // USB Serial
182
+#define WIFI_SERIAL              3  // USART3
183
+#define MKS_WIFI_MODULE_SERIAL   1  // USART1
184
+#define MKS_WIFI_MODULE_SPI      2  // SPI2
185
+
186
+#ifndef SDCARD_CONNECTION
187
+  #define SDCARD_CONNECTION              ONBOARD
188
+#endif
189
+
190
+// MKS WIFI MODULE
191
+#if ENABLED(MKS_WIFI_MODULE)
192
+  #define WIFI_IO0_PIN                      PC13
193
+  #define WIFI_IO1_PIN                      PC7
194
+  #define WIFI_RESET_PIN                    PE9
195
+#endif
196
+
197
+// MKS TEST
198
+#if ENABLED(MKS_TEST)
199
+  #define MKS_TEST_POWER_LOSS_PIN           PA13  // PW_DET
200
+  #define MKS_TEST_PS_ON_PIN                PB2   // PW_OFF
201
+#endif
202
+
203
+//
204
+// Onboard SD card
205
+//
206
+// detect pin doesn't work when ONBOARD and NO_SD_HOST_DRIVE disabled
207
+#if SD_CONNECTION_IS(ONBOARD)
208
+  #define ENABLE_SPI3
209
+  #define SD_SS_PIN                         -1
210
+  #define SDSS                              PC9
211
+  #define SD_SCK_PIN                        PC10
212
+  #define SD_MISO_PIN                       PC11
213
+  #define SD_MOSI_PIN                       PC12
214
+  #define SD_DETECT_PIN                     PD12
215
+#endif
216
+
217
+#define SPI_FLASH
218
+#if ENABLED(SPI_FLASH)
219
+  #define HAS_SPI_FLASH                        1
220
+  #define SPI_DEVICE                           2
221
+  #define SPI_FLASH_SIZE               0x1000000
222
+  #define SPI_FLASH_CS_PIN                  PB12
223
+  #define SPI_FLASH_MOSI_PIN                PC3
224
+  #define SPI_FLASH_MISO_PIN                PC2
225
+  #define SPI_FLASH_SCK_PIN                 PB13
226
+#endif
227
+
228
+/**
229
+ *                ------                                     ------
230
+ * (BEEPER)  PC5 |10  9 | PE13 (BTN_ENC)   (SPI1 MISO)  PA6 |10  9 | PA5  (SPI1 SCK)
231
+ * (LCD_EN) PD13 | 8  7 | PC6  (LCD_RS)      (BTN_EN1)  PE8 | 8  7 | PE10 (SPI1 CS)
232
+ * (LCD_D4) PE14   6  5 | PE15 (LCD_D5)      (BTN_EN2) PE11   6  5 | PA7  (SPI1 MOSI)
233
+ * (LCD_D6) PD11 | 4  3 | PD10 (LCD_D7)      (SPI1_RS) PE12 | 4  3 | RESET
234
+ *           GND | 2  1 | 5V                            GND | 2  1 | 3.3V
235
+ *                ------                                     ------
236
+ *                 EXP1                                       EXP2
237
+ */
238
+#define EXP1_03_PIN                         PD10
239
+#define EXP1_04_PIN                         PD11
240
+#define EXP1_05_PIN                         PE15
241
+#define EXP1_06_PIN                         PE14
242
+#define EXP1_07_PIN                         PC6
243
+#define EXP1_08_PIN                         PD13
244
+#define EXP1_09_PIN                         PE13
245
+#define EXP1_10_PIN                         PC5
246
+
247
+#define EXP2_03_PIN                         -1    // RESET
248
+#define EXP2_04_PIN                         PE12
249
+#define EXP2_05_PIN                         PA7
250
+#define EXP2_06_PIN                         PE11
251
+#define EXP2_07_PIN                         PE10
252
+#define EXP2_08_PIN                         PE8
253
+#define EXP2_09_PIN                         PA5
254
+#define EXP2_10_PIN                         PA6
255
+
256
+//
257
+// SPI SD Card
258
+//
259
+#if SD_CONNECTION_IS(LCD)
260
+  #define ENABLE_SPI1
261
+  #define SDSS                       EXP2_07_PIN
262
+  #define SD_SCK_PIN                 EXP2_09_PIN
263
+  #define SD_MISO_PIN                EXP2_10_PIN
264
+  #define SD_MOSI_PIN                EXP2_05_PIN
265
+  #define SD_DETECT_PIN              EXP2_04_PIN
266
+#endif
267
+
268
+//
269
+// LCD / Controller
270
+//
271
+#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI)
272
+  #define TFT_CS_PIN                 EXP1_04_PIN
273
+  #define TFT_SCK_PIN                EXP2_09_PIN
274
+  #define TFT_MISO_PIN               EXP2_10_PIN
275
+  #define TFT_MOSI_PIN               EXP2_05_PIN
276
+  #define TFT_DC_PIN                 EXP1_03_PIN
277
+  #define TFT_RST_PIN                EXP1_07_PIN
278
+  #define TFT_A0_PIN                  TFT_DC_PIN
279
+
280
+  #define TFT_RESET_PIN              EXP1_07_PIN
281
+  #define TFT_BACKLIGHT_PIN          EXP1_08_PIN
282
+
283
+  #define TOUCH_BUTTONS_HW_SPI
284
+  #define TOUCH_BUTTONS_HW_SPI_DEVICE          1
285
+
286
+  #define LCD_BACKLIGHT_PIN          EXP1_08_PIN
287
+  #ifndef TFT_WIDTH
288
+    #define TFT_WIDTH                        480
289
+  #endif
290
+  #ifndef TFT_HEIGHT
291
+    #define TFT_HEIGHT                       320
292
+  #endif
293
+
294
+  #define TOUCH_CS_PIN               EXP1_06_PIN  // SPI1_NSS
295
+  #define TOUCH_SCK_PIN              EXP2_09_PIN  // SPI1_SCK
296
+  #define TOUCH_MISO_PIN             EXP2_10_PIN  // SPI1_MISO
297
+  #define TOUCH_MOSI_PIN             EXP2_05_PIN  // SPI1_MOSI
298
+
299
+  #define LCD_READ_ID                       0xD3
300
+  #define LCD_USE_DMA_SPI
301
+
302
+  #define TFT_BUFFER_SIZE                  14400
303
+
304
+  #ifndef TOUCH_CALIBRATION_X
305
+    #define TOUCH_CALIBRATION_X           -17253
306
+  #endif
307
+  #ifndef TOUCH_CALIBRATION_Y
308
+    #define TOUCH_CALIBRATION_Y            11579
309
+  #endif
310
+  #ifndef TOUCH_OFFSET_X
311
+    #define TOUCH_OFFSET_X                   514
312
+  #endif
313
+  #ifndef TOUCH_OFFSET_Y
314
+    #define TOUCH_OFFSET_Y                   -24
315
+  #endif
316
+  #ifndef TOUCH_ORIENTATION
317
+    #define TOUCH_ORIENTATION    TOUCH_LANDSCAPE
318
+  #endif
319
+
320
+#elif HAS_WIRED_LCD
321
+
322
+  #define LCD_PINS_ENABLE            EXP1_08_PIN
323
+  #define LCD_PINS_RS                EXP1_07_PIN
324
+  #define LCD_BACKLIGHT_PIN                 -1
325
+
326
+  // MKS MINI12864 and MKS LCD12864B; If using MKS LCD12864A (Need to remove RPK2 resistor)
327
+  #if ENABLED(MKS_MINI_12864)
328
+    //#define LCD_BACKLIGHT_PIN             -1
329
+    //#define LCD_RESET_PIN                 -1
330
+    #define DOGLCD_A0                EXP1_04_PIN
331
+    #define DOGLCD_CS                EXP1_05_PIN
332
+    //#define DOGLCD_SCK             EXP2_09_PIN
333
+    //#define DOGLCD_MOSI            EXP2_05_PIN
334
+
335
+    // Required for MKS_MINI_12864 with this board
336
+    //#define MKS_LCD12864B
337
+    //#undef SHOW_BOOTSCREEN
338
+
339
+  #elif ENABLED(MKS_MINI_12864_V3)
340
+    #define DOGLCD_CS                EXP1_08_PIN
341
+    #define DOGLCD_A0                EXP1_07_PIN
342
+    #define LCD_PINS_DC                DOGLCD_A0
343
+    #define LCD_BACKLIGHT_PIN               -1
344
+    #define LCD_RESET_PIN            EXP1_06_PIN
345
+    #define NEOPIXEL_PIN             EXP1_05_PIN
346
+    #define DOGLCD_MOSI              EXP2_05_PIN
347
+    #define DOGLCD_SCK               EXP2_09_PIN
348
+    #if SD_CONNECTION_IS(ONBOARD)
349
+      #define FORCE_SOFT_SPI
350
+    #endif
351
+    //#define LCD_SCREEN_ROT_180
352
+
353
+  #else                                           // !MKS_MINI_12864
354
+
355
+    #define LCD_PINS_D4              EXP1_06_PIN
356
+    #if ENABLED(ULTIPANEL)
357
+      #define LCD_PINS_D5            EXP1_05_PIN
358
+      #define LCD_PINS_D6            EXP1_04_PIN
359
+      #define LCD_PINS_D7            EXP1_03_PIN
360
+    #endif
361
+
362
+    #define BOARD_ST7920_DELAY_1              96
363
+    #define BOARD_ST7920_DELAY_2              48
364
+    #define BOARD_ST7920_DELAY_3             600
365
+
366
+  #endif // !MKS_MINI_12864
367
+
368
+#endif // HAS_WIRED_LCD
369
+
370
+#if ANY(TFT_COLOR_UI, TFT_LVGL_UI, TFT_CLASSIC_UI, HAS_WIRED_LCD)
371
+  #define BEEPER_PIN                 EXP1_10_PIN
372
+  #define BTN_EN1                    EXP2_08_PIN
373
+  #define BTN_EN2                    EXP2_06_PIN
374
+  #define BTN_ENC                    EXP1_09_PIN
375
+#endif

+ 44
- 0
ini/stm32f4.ini Просмотреть файл

@@ -405,6 +405,49 @@ build_flags       = ${env:mks_robin_nano_v3_usb_flash_drive.build_flags}
405 405
 build_unflags     = -DUSBD_USE_CDC
406 406
 
407 407
 #
408
+# MKS Eagle
409
+# 5 TMC2209 uart mode on board
410
+#
411
+[env:mks_eagle]
412
+platform                    = ${common_stm32.platform}
413
+extends                     = stm32_variant
414
+board                       = marlin_STM32F407VGT6_CCM
415
+board_build.variant         = MARLIN_F4x7Vx
416
+board_build.offset          = 0xC000
417
+board_upload.offset_address = 0x0800C000
418
+board_build.rename          = mks_eagle.bin
419
+build_flags                 = ${stm32_variant.build_flags} ${stm32f4_I2C1.build_flags}
420
+                              -DHAL_PCD_MODULE_ENABLED
421
+                              -DSTM32_FLASH_SIZE=512
422
+debug_tool                  = jlink
423
+upload_protocol             = jlink
424
+
425
+#
426
+# MKS Eagle with USB Flash Drive Support
427
+# Currently, using a STM32duino fork, until USB Host get merged
428
+#
429
+[env:mks_eagle_usb_flash_drive]
430
+platform          = ${common_stm32.platform}
431
+extends           = env:mks_eagle
432
+platform_packages = ${stm_flash_drive.platform_packages}
433
+build_flags       = ${stm_flash_drive.build_flags} ${stm32f4_I2C1.build_flags}
434
+                    -DUSE_USBHOST_HS
435
+                    -DUSBD_IRQ_PRIO=5
436
+                    -DUSBD_IRQ_SUBPRIO=6
437
+                    -DUSE_USB_HS_IN_FS
438
+
439
+#
440
+# MKS Eagle with USB Flash Drive Support and Shared Media
441
+# Currently, using a STM32duino fork, until USB Host and USB Device MSC get merged
442
+#
443
+[env:mks_eagle_usb_flash_drive_msc]
444
+platform          = ${common_stm32.platform}
445
+extends           = env:mks_eagle_usb_flash_drive
446
+build_flags       = ${env:mks_eagle_usb_flash_drive.build_flags}
447
+                    -DUSBD_USE_CDC_MSC
448
+build_unflags     = -DUSBD_USE_CDC
449
+
450
+#
408 451
 # This I2C1(PB8:I2C1_SCL PB9:I2C1_SDA) is used by MKS Monster8
409 452
 #
410 453
 [stm32f4_I2C1_CAN]
@@ -423,6 +466,7 @@ board_upload.offset_address = 0x0800C000
423 466
 board_build.rename          = mks_monster8.bin
424 467
 build_flags                 = ${stm32_variant.build_flags} ${stm32f4_I2C1_CAN.build_flags}
425 468
                               -DHAL_PCD_MODULE_ENABLED -DTIMER_SERIAL=TIM4
469
+                              -DSTM32_FLASH_SIZE=512
426 470
 debug_tool                  = jlink
427 471
 upload_protocol             = jlink
428 472
 

Загрузка…
Отмена
Сохранить