Browse Source

Add NUCLEO-F767ZI dev board (#19373)

Co-authored-by: Lorenzo Delana <lorenzo.delana@gmail.com>
Jason Smith 3 years ago
parent
commit
d896dedf9b

+ 1
- 1
Marlin/src/HAL/shared/backtrace/unwmemaccess.cpp View File

@@ -85,7 +85,7 @@
85 85
   #define START_FLASH_ADDR  0x08000000
86 86
   #define END_FLASH_ADDR    0x08100000
87 87
 
88
-#elif MB(REMRAM_V1)
88
+#elif MB(REMRAM_V1, NUCLEO_F767ZI)
89 89
 
90 90
   // For STM32F765VI in RemRam v1
91 91
   //  SRAM  (0x20000000 - 0x20080000) (512kb)

+ 1
- 0
Marlin/src/core/boards.h View File

@@ -363,6 +363,7 @@
363 363
 #define BOARD_REMRAM_V1               5001  // RemRam v1
364 364
 #define BOARD_TEENSY41                5002  // Teensy 4.1
365 365
 #define BOARD_T41U5XBB                5003  // T41U5XBB Teensy 4.1 breakout board
366
+#define BOARD_NUCLEO_F767ZI           5004  // ST NUCLEO-F767ZI Dev Board
366 367
 
367 368
 //
368 369
 // Espressif ESP32 WiFi

+ 2
- 0
Marlin/src/pins/pins.h View File

@@ -634,6 +634,8 @@
634 634
   #include "stm32f7/pins_THE_BORG.h"            // STM32F7                                env:STM32F7
635 635
 #elif MB(REMRAM_V1)
636 636
   #include "stm32f7/pins_REMRAM_V1.h"           // STM32F7                                env:STM32F7
637
+#elif MB(NUCLEO_F767ZI)
638
+  #include "stm32f7/pins_NUCLEO_F767ZI.h"       // STM32F7                                env:NUCLEO_F767ZI
637 639
 #elif MB(TEENSY41)
638 640
   #include "teensy4/pins_TEENSY41.h"            // Teensy-4.x                             env:teensy41
639 641
 #elif MB(T41U5XBB)

+ 201
- 0
Marlin/src/pins/stm32f7/pins_NUCLEO_F767ZI.h View File

@@ -0,0 +1,201 @@
1
+/**
2
+ * Marlin 3D Printer Firmware
3
+ * Copyright (c) 2020 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
+#ifndef STM32F767xx
25
+  #error "Oops! Select an STM32F767 environment"
26
+#endif
27
+
28
+#define BOARD_INFO_NAME      "NUCLEO-F767ZI"
29
+#define DEFAULT_MACHINE_NAME "Prototype Board"
30
+
31
+#if NO_EEPROM_SELECTED
32
+  #define FLASH_EEPROM_EMULATION                  // Use Flash-based EEPROM emulation
33
+#endif
34
+
35
+#if ENABLED(FLASH_EEPROM_EMULATION)
36
+  // Decrease delays and flash wear by spreading writes across the
37
+  // 128 kB sector allocated for EEPROM emulation.
38
+  // Not yet supported on F7 hardware
39
+  // #define FLASH_EEPROM_LEVELING
40
+#endif
41
+
42
+/**
43
+ * Timer assignments
44
+ * 
45
+ * TIM1 -
46
+ * TIM2 - Hardware PWM (Fan/Heater Pins)
47
+ * TIM3 - Hardware PWM (Servo Pins)
48
+ * TIM4 - STEP_TIMER (Marlin)
49
+ * TIM5 -
50
+ * TIM6 - TIMER_TONE (variant.h)
51
+ * TIM7 - TIMER_SERVO (variant.h)
52
+ * TIM9 - TIMER_SERIAL (platformio.ini)
53
+ * TIM10 - For some reason trips Watchdog when used for SW Serial
54
+ * TIM11 -
55
+ * TIM12 -
56
+ * TIM13 -
57
+ * TIM14 - TEMP_TIMER (Marlin)
58
+ * 
59
+ */
60
+#define STEP_TIMER 4
61
+#define TEMP_TIMER 14
62
+
63
+
64
+/**
65
+ * These pin assignments are arbitrary and intending for testing purposes.
66
+ * Assignments may not be ideal, and not every assignment has been tested.
67
+ * Proceed at your own risk.
68
+ *                                                            _CN7_
69
+ *                                              (X_STEP) PC6 | · · | PB8 (X_EN) 
70
+ *                                              (X_DIR) PB15 | · · | PB9 (X_CS)
71
+ *                                             (LCD_D4) PB13 | · · | AVDD
72
+ *                 _CN8_                                PB12 | · · | GND
73
+ *             NC | · · | PC8                (HEATER_0) PA15 | · · | PA5  (SCLK)
74
+ *          IOREF | · · | PC9                   (BEEPER) PC7 | · · | PA6  (MISO)
75
+ *          RESET | · · | PC10              (SERVO1_PIN) PB5 | · · | PA7  (MOSI)
76
+ *          +3.3V | · · | PC11              (HEATER_BED) PB3 | · · | PD14 (SD_DETECT)
77
+ *            +5V | · · | PC12                    (SDSS) PA4 | · · | PD15 (LCD_ENABLE)
78
+ *            GND | · · | PD2               (SERVO0_PIN) PB4 | · · | PF12 (LCD_RS)
79
+ *            GND | · · | PG2                                  ̄ ̄ ̄
80
+ *            VIN | · · | PG3                                 
81
+_*                  ̄ ̄ ̄                                      _CN10
82
+ *                                                      AVDD | · · | PF13 (BTN_EN1)
83
+ *                 _CN9_                                AGND | · · | PE9  (BTN_EN2)
84
+ *   (TEMP_0) PA3 | · · | PD7                            GND | · · | PE11 (BTN_ENC)
85
+ * (TEMP_BED) PC0 | · · | PD6                            PB1 | · · | PF14
86
+ *            PC3 | · · | PD5                            PC2 | · · | PE13
87
+ *            PF3 | · · | PD4                            PF4 | · · | PF15
88
+ *            PF5 | · · | PD3                   (E_STEP) PB6 | · · | PG14 (E_EN)
89
+ *           PF10 | · · | GND                    (E_DIR) PB2 | · · | PG9  (E_CS)
90
+ *             NC | · · | PE2                            GND | · · | PE8
91
+ *            PA7 | · · | PE4                           PD13 | · · | PE7
92
+ *            PF2 | · · | PE5                           PD12 | · · | GND
93
+ *   (Y_STEP) PF1 | · · | PE6 (Y_EN)           (Z_STEP) PD11 | · · | PE10 (Z_EN)
94
+ *    (Y_DIR) PF0 | · · | PE3 (Y_CS)             (Z_DIR) PE2 | · · | PE12 (Z_CS)
95
+ *            GND | · · | PF8                            GND | · · | PE14
96
+ *    (Z_MAX) PD0 | · · | PF7 (X_MIN)                    PA0 | · · | PE15
97
+ *    (Z_MIN) PD1 | · · | PF9 (X_MAX)                    PB0 | · · | PB10 (FAN)
98
+ *    (Y_MAX) PG0 | · · | PG1 (Y_MIN)                    PE0 | · · | PB11 (FAN1)
99
+ *                  ̄ ̄ ̄                                      ̄ ̄ ̄ ̄
100
+ */
101
+
102
+#define X_MIN_PIN                           PF7
103
+#define X_MAX_PIN                           PF9
104
+#define Y_MIN_PIN                           PG1
105
+#define Y_MAX_PIN                           PG0
106
+#define Z_MIN_PIN                           PD1
107
+#define Z_MAX_PIN                           PD0
108
+
109
+//
110
+// Steppers
111
+//
112
+#define X_STEP_PIN                          PC6
113
+#define X_DIR_PIN                           PB15
114
+#define X_ENABLE_PIN                        PB8
115
+#define X_CS_PIN                            PB9
116
+
117
+#define Y_STEP_PIN                          PF1
118
+#define Y_DIR_PIN                           PF0
119
+#define Y_ENABLE_PIN                        PE6
120
+#define Y_CS_PIN                            PE3
121
+
122
+#define Z_STEP_PIN                          PD11
123
+#define Z_DIR_PIN                           PE2
124
+#define Z_ENABLE_PIN                        PE10
125
+#define Z_CS_PIN                            PE12
126
+
127
+#define E0_STEP_PIN                         PB6
128
+#define E0_DIR_PIN                          PB2
129
+#define E0_ENABLE_PIN                       PG14
130
+#define E0_CS_PIN                           PG9
131
+
132
+#if HAS_TMC_UART
133
+  #define X_SERIAL_TX_PIN                   PB9
134
+  #define X_SERIAL_RX_PIN                   PB9
135
+
136
+  #define Y_SERIAL_TX_PIN                   PE3
137
+  #define Y_SERIAL_RX_PIN                   PE3
138
+
139
+  #define Z_SERIAL_TX_PIN                   PE12
140
+  #define Z_SERIAL_RX_PIN                   PE12
141
+
142
+  #define E_SERIAL_TX_PIN                   PG9
143
+  #define E_SERIAL_RX_PIN                   PG9      
144
+#endif
145
+
146
+//
147
+// Temperature Sensors
148
+//
149
+#define TEMP_0_PIN                          PA3
150
+#define TEMP_BED_PIN                        PC0
151
+
152
+//
153
+// Heaters / Fans
154
+//
155
+#define HEATER_0_PIN                        PA15 // PWM Capable, TIM2_CH1
156
+#define HEATER_BED_PIN                      PB3  // PWM Capable, TIM2_CH2
157
+
158
+#ifndef FAN_PIN
159
+  #define FAN_PIN                           PB10 // PWM Capable, TIM2_CH3
160
+#endif
161
+#define FAN1_PIN                            PB11 // PWM Capable, TIM2_CH4
162
+
163
+#ifndef E0_AUTO_FAN_PIN
164
+  #define E0_AUTO_FAN_PIN               FAN1_PIN
165
+#endif
166
+
167
+//
168
+// Servos
169
+//
170
+#define SERVO0_PIN                          PB4 // PWM Capable, TIM3_CH1
171
+#define SERVO1_PIN                          PB5 // PWM Capable, TIM3_CH2
172
+
173
+// SPI for external SD Card (Not entirely sure this will work)
174
+#define SCK_PIN                             PA5
175
+#define MISO_PIN                            PA6
176
+#define MOSI_PIN                            PA7
177
+#define SS_PIN                              PA4
178
+#define SDSS                                PA4
179
+
180
+#define LED_PIN                             LED_BLUE
181
+
182
+//
183
+// LCD / Controller
184
+//
185
+#if ENABLED(REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER)
186
+  #define BEEPER_PIN                        PC7  // LCD_BEEPER
187
+  #define BTN_ENC                           PE11  // BTN_ENC
188
+  #define SD_DETECT_PIN                     PD14
189
+  #define LCD_PINS_RS                       PF12  // LCD_RS
190
+  #define LCD_PINS_ENABLE                   PD15  // LCD_EN
191
+  #define LCD_PINS_D4                       PB13  // LCD_D4
192
+  // #define LCD_PINS_D5
193
+  // #define LCD_PINS_D6
194
+  // #define LCD_PINS_D7
195
+  #define BTN_EN1                           PF13  // BTN_EN1
196
+  #define BTN_EN2                           PE9  // BTN_EN2
197
+
198
+  #define BOARD_ST7920_DELAY_1  DELAY_NS(125)
199
+  #define BOARD_ST7920_DELAY_2  DELAY_NS(63)
200
+  #define BOARD_ST7920_DELAY_3  DELAY_NS(780)
201
+#endif

+ 11
- 0
platformio.ini View File

@@ -857,6 +857,17 @@ build_flags   = ${common.build_flags} -DUSE_STM32GENERIC -DSTM32GENERIC -DSTM32F
857 857
 src_filter    = ${common.default_src_filter} +<src/HAL/STM32_F4_F7> -<src/HAL/STM32_F4_F7/STM32F4>
858 858
 
859 859
 #
860
+# ST NUCLEO-F767ZI Development Board
861
+# This environment is for testing purposes prior to control boards
862
+# being readily available based on STM32F7 MCUs
863
+#
864
+[env:NUCLEO_F767ZI]
865
+platform      = ${common_stm32.platform}
866
+extends       = common_stm32
867
+board         = nucleo_f767zi
868
+build_flags   = ${common_stm32.build_flags} -DTIMER_SERIAL=TIM9
869
+
870
+#
860 871
 # ARMED (STM32)
861 872
 #
862 873
 [env:ARMED]

Loading…
Cancel
Save