Browse Source

Simplify platformio.ini with 'extends' (#16035)

- Add [env] with default settings
- Use 'extends' to shrink similar env entries
Björn Wedi 5 years ago
parent
commit
3a88cfd992
1 changed files with 150 additions and 315 deletions
  1. 150
    315
      platformio.ini

+ 150
- 315
platformio.ini View File

@@ -36,6 +36,13 @@ lib_deps =
36 36
   SailfishRGB_LED=https://github.com/mikeshub/SailfishRGB_LED/archive/master.zip
37 37
   SlowSoftI2CMaster=https://github.com/mikeshub/SlowSoftI2CMaster/archive/master.zip
38 38
 
39
+# Globally defined properties
40
+# inherited by all environments
41
+[env]
42
+framework   = arduino
43
+build_flags = ${common.build_flags}
44
+lib_deps    = ${common.lib_deps}
45
+
39 46
 #################################
40 47
 #                               #
41 48
 #   Unique Core Architectures   #
@@ -51,9 +58,7 @@ lib_deps =
51 58
 #
52 59
 [env:megaatmega2560]
53 60
 platform          = atmelavr
54
-framework         = arduino
55 61
 board             = megaatmega2560
56
-build_flags       = ${common.build_flags}
57 62
 board_build.f_cpu = 16000000L
58 63
 lib_deps          = ${common.lib_deps}
59 64
   TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
@@ -64,15 +69,56 @@ monitor_speed     = 250000
64 69
 # ATmega1280
65 70
 #
66 71
 [env:megaatmega1280]
67
-platform          = atmelavr
68
-framework         = arduino
72
+extends           = env:megaatmega2560
69 73
 board             = megaatmega1280
70
-build_flags       = ${common.build_flags}
71
-board_build.f_cpu = 16000000L
72
-lib_deps          = ${common.lib_deps}
74
+
75
+#
76
+# RAMBo
77
+#
78
+[env:rambo]
79
+extends           = env:megaatmega2560
80
+board             = reprap_rambo
81
+
82
+#
83
+# FYSETC F6 V1.3
84
+#
85
+[env:fysetc_f6_13]
86
+extends           = env:megaatmega2560
87
+board             = fysetc_f6_13
88
+
89
+#
90
+# Sanguinololu (ATmega644p)
91
+#
92
+[env:sanguino_atmega644p]
93
+platform      = atmelavr
94
+board         = sanguino_atmega644p
95
+lib_deps      = ${common.lib_deps}
73 96
   TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
74
-src_filter        = ${common.default_src_filter} +<src/HAL/HAL_AVR>
75
-monitor_speed     = 250000
97
+src_filter    = ${common.default_src_filter} +<src/HAL/HAL_AVR>
98
+monitor_speed = 250000
99
+
100
+#
101
+# Sanguinololu (ATmega1284p)
102
+#
103
+[env:sanguino_atmega1284p]
104
+extends       = env:sanguino_atmega644p
105
+board         = sanguino_atmega1284p
106
+
107
+#
108
+# Melzi and clones (ATmega1284p)
109
+#
110
+[env:melzi]
111
+extends       = env:sanguino_atmega1284p
112
+build_flags   = ${common.build_flags} -fmerge-all-constants
113
+lib_ignore    = TMCStepper
114
+upload_speed  = 57600
115
+
116
+#
117
+# Melzi and clones (Optiboot bootloader)
118
+#
119
+[env:melzi_optiboot]
120
+extends       = env:melzi
121
+upload_speed  = 115200
76 122
 
77 123
 #
78 124
 # AT90USB1286 boards using CDC bootloader
@@ -83,9 +129,7 @@ monitor_speed     = 250000
83 129
 #
84 130
 [env:at90usb1286_cdc]
85 131
 platform      = teensy
86
-framework     = arduino
87 132
 board         = at90usb1286
88
-build_flags   = ${common.build_flags}
89 133
 lib_deps      = ${common.lib_deps}
90 134
   TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
91 135
 src_filter    = ${common.default_src_filter} +<src/HAL/HAL_AVR>
@@ -98,14 +142,7 @@ monitor_speed = 250000
98 142
 # - ? 5DPRINT ?
99 143
 #
100 144
 [env:at90usb1286_dfu]
101
-platform      = teensy
102
-framework     = arduino
103
-board         = at90usb1286
104
-build_flags   = ${common.build_flags}
105
-lib_deps      = ${common.lib_deps}
106
-  TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
107
-src_filter    = ${common.default_src_filter} +<src/HAL/HAL_AVR>
108
-monitor_speed = 250000
145
+extends       = env:at90usb1286_cdc
109 146
 
110 147
 #
111 148
 # Due (Atmel SAM3X8E ARM Cortex-M3)
@@ -115,38 +152,26 @@ monitor_speed = 250000
115 152
 #
116 153
 [env:DUE]
117 154
 platform      = atmelsam
118
-framework     = arduino
119 155
 board         = due
120
-build_flags   = ${common.build_flags}
121
-lib_deps      = ${common.lib_deps}
122 156
 src_filter    = ${common.default_src_filter} +<src/HAL/HAL_DUE>
123 157
 monitor_speed = 250000
158
+
124 159
 [env:DUE_USB]
125
-platform      = atmelsam
126
-framework     = arduino
160
+extends       = env:DUE
127 161
 board         = dueUSB
128
-build_flags   = ${common.build_flags}
129
-lib_deps      = ${common.lib_deps}
130
-src_filter    = ${common.default_src_filter} +<src/HAL/HAL_DUE>
131
-monitor_speed = 250000
162
+
132 163
 [env:DUE_debug]
133 164
 # Used when WATCHDOG_RESET_MANUAL is enabled
134
-platform      = atmelsam
135
-framework     = arduino
136
-board         = due
165
+extends       = env:DUE
137 166
 build_flags   = ${common.build_flags}
138 167
   -funwind-tables
139 168
   -mpoke-function-name
140
-lib_deps      = ${common.lib_deps}
141
-src_filter    = ${common.default_src_filter} +<src/HAL/HAL_DUE>
142
-monitor_speed = 250000
143 169
 
144 170
 #
145 171
 # NXP LPC176x ARM Cortex-M3
146 172
 #
147 173
 [env:LPC1768]
148 174
 platform          = https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/0.1.2.zip
149
-framework         = arduino
150 175
 board             = nxp_lpc1768
151 176
 build_flags       = -DU8G_HAL_LINKS -IMarlin/src/HAL/HAL_LPC1768/include -IMarlin/src/HAL/HAL_LPC1768/u8g ${common.build_flags}
152 177
 # debug options for backtrace
@@ -169,113 +194,53 @@ extends           = env:LPC1768
169 194
 board             = nxp_lpc1769
170 195
 
171 196
 #
172
-# Sanguinololu (ATmega644p)
173
-#
174
-[env:sanguino_atmega644p]
175
-platform      = atmelavr
176
-framework     = arduino
177
-board         = sanguino_atmega644p
178
-build_flags   = ${common.build_flags}
179
-lib_deps      = ${common.lib_deps}
180
-  TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
181
-src_filter    = ${common.default_src_filter} +<src/HAL/HAL_AVR>
182
-monitor_speed = 250000
183
-
184
-#
185
-# Sanguinololu (ATmega1284p)
186
-#
187
-[env:sanguino_atmega1284p]
188
-platform      = atmelavr
189
-framework     = arduino
190
-board         = sanguino_atmega1284p
191
-build_flags   = ${common.build_flags}
192
-lib_deps      = ${common.lib_deps}
193
-  TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
194
-src_filter    = ${common.default_src_filter} +<src/HAL/HAL_AVR>
195
-monitor_speed = 250000
196
-
197
+# STM32F1 base
197 198
 #
198
-# Melzi and clones (ATmega1284p)
199
-#
200
-[env:melzi]
201
-platform      = atmelavr
202
-framework     = arduino
203
-board         = sanguino_atmega1284p
204
-build_flags   = ${common.build_flags} -fmerge-all-constants
205
-upload_speed  = 57600
206
-lib_deps      = ${common.lib_deps}
207
-lib_ignore    = TMCStepper
208
-src_filter    = ${common.default_src_filter} +<src/HAL/HAL_AVR>
209
-monitor_speed = 250000
210
-
211
-#
212
-# Melzi and clones (Optiboot bootloader)
213
-#
214
-[env:melzi_optiboot]
215
-platform      = atmelavr
216
-framework     = arduino
217
-board         = sanguino_atmega1284p
218
-build_flags   = ${common.build_flags}
219
-upload_speed  = 115200
220
-lib_deps      = ${common.lib_deps}
221
-lib_ignore    = TMCStepper
222
-src_filter    = ${common.default_src_filter} +<src/HAL/HAL_AVR>
199
+[env:STM32F1_base]
200
+platform      = ststm32
201
+build_flags   = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
202
+  ${common.build_flags} -std=gnu++14
203
+build_unflags = -std=gnu++11
204
+src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
205
+lib_ignore    = Adafruit NeoPixel, SPI
223 206
 monitor_speed = 250000
224 207
 
225 208
 #
226
-# RAMBo
209
+# STM32F103RC
227 210
 #
228
-[env:rambo]
229
-platform          = atmelavr
230
-framework         = arduino
231
-board             = reprap_rambo
232
-build_flags       = ${common.build_flags}
233
-board_build.f_cpu = 16000000L
211
+[env:STM32F103RC_base]
212
+extends           = env:STM32F1_base
213
+board             = genericSTM32F103RC
214
+platform_packages = tool-stm32duino
234 215
 lib_deps          = ${common.lib_deps}
235
-  TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
236
-src_filter        = ${common.default_src_filter} +<src/HAL/HAL_AVR>
237
-monitor_speed     = 250000
216
+  SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
217
+monitor_speed     = 115200
238 218
 
239 219
 #
240 220
 # STM32F103RE
241 221
 #
242 222
 [env:STM32F103RE]
243
-platform      = ststm32
244
-framework     = arduino
245
-board         = genericSTM32F103RE
246
-build_flags   = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
247
-  ${common.build_flags} -std=gnu++14
248
-  -DDEBUG_LEVEL=0
249
-build_unflags = -std=gnu++11
250
-lib_deps      = ${common.lib_deps}
251
-lib_ignore    = Adafruit NeoPixel, SPI
252
-src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
253
-monitor_speed = 250000
254
-debug_tool    = stlink
223
+extends         = env:STM32F1_base
224
+board           = genericSTM32F103RE
225
+build_flags     = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
226
+  ${common.build_flags} -std=gnu++14 -DDEBUG_LEVEL=0
227
+src_filter      = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
228
+debug_tool      = stlink
255 229
 upload_protocol = stlink
256 230
 
257 231
 #
258 232
 # STM32F103RC_fysetc
259 233
 #
260 234
 [env:STM32F103RC_fysetc]
261
-platform          = ststm32
262
-framework         = arduino
263
-board             = genericSTM32F103RC
235
+extends           = env:STM32F103RC_base
264 236
 #board_build.core = maple
265
-platform_packages = tool-stm32duino
266 237
 extra_scripts     = buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py
267 238
 build_flags       = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
268
-  ${common.build_flags} -std=gnu++14
269
-  -DDEBUG_LEVEL=0 -DHAVE_SW_SERIAL
270
-build_unflags     = -std=gnu++11
271
-lib_deps          = ${common.lib_deps}
272
-  SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
273
-lib_ignore        = Adafruit NeoPixel, SPI
239
+  ${common.build_flags} -std=gnu++14 -DDEBUG_LEVEL=0 -DHAVE_SW_SERIAL
274 240
 lib_ldf_mode      = chain
275
-src_filter        = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
276
-monitor_speed     = 250000
277 241
 debug_tool        = stlink
278 242
 upload_protocol   = serial
243
+monitor_speed     = 250000
279 244
 
280 245
 #
281 246
 # BigTree SKR Mini V1.1 / SKR mini E3 / SKR E3 DIP (STM32F103RCT6 ARM Cortex-M3)
@@ -289,143 +254,64 @@ upload_protocol   = serial
289 254
 #
290 255
 
291 256
 [env:STM32F103RC_bigtree]
292
-platform          = ststm32
293
-framework         = arduino
294
-board             = genericSTM32F103RC
295
-platform_packages = tool-stm32duino
257
+extends           = env:STM32F103RC_base
296 258
 extra_scripts     = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
297 259
 build_flags       = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
298 260
   ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4
299
-build_unflags     = -std=gnu++11
300
-lib_deps          = ${common.lib_deps}
301
-  SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
302
-lib_ignore        = Adafruit NeoPixel, SPI
303
-src_filter        = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
304
-monitor_speed     = 115200
305 261
 
306 262
 [env:STM32F103RC_bigtree_USB]
307
-platform          = ststm32
308
-framework         = arduino
309
-board             = genericSTM32F103RC
310
-platform_packages = tool-stm32duino
311
-extra_scripts     = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
263
+extends           = env:STM32F103RC_bigtree
312 264
 build_flags       = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
313
-  ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DUSE_USB_COMPOSITE -DHAVE_SW_SERIAL -DSS_TIMER=4
314
-build_unflags     = -std=gnu++11
315
-lib_deps          = ${common.lib_deps}
316
-  SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
317
-lib_ignore        = Adafruit NeoPixel, SPI
318
-src_filter        = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
319
-monitor_speed     = 115200
265
+  ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4 -DUSE_USB_COMPOSITE
320 266
 
321 267
 [env:STM32F103RC_bigtree_512K]
322
-platform          = ststm32
323
-framework         = arduino
324
-board             = genericSTM32F103RC
268
+extends           = env:STM32F103RC_bigtree
325 269
 board_upload.maximum_size=524288
326
-platform_packages = tool-stm32duino
327
-extra_scripts     = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
328 270
 build_flags       = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
329 271
   ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4 -DSTM32_FLASH_SIZE=512
330
-build_unflags     = -std=gnu++11
331
-lib_deps          = ${common.lib_deps}
332
-  SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
333
-lib_ignore        = Adafruit NeoPixel, SPI
334
-src_filter        = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
335
-monitor_speed     = 115200
336 272
 
337 273
 [env:STM32F103RC_bigtree_512K_USB]
338
-platform          = ststm32
339
-framework         = arduino
340
-board             = genericSTM32F103RC
274
+extends           = env:STM32F103RC_bigtree_512K
341 275
 board_upload.maximum_size=524288
342
-platform_packages = tool-stm32duino
343
-extra_scripts     = buildroot/share/PlatformIO/scripts/STM32F103RC_SKR_MINI.py
344 276
 build_flags       = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
345
-  ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DUSE_USB_COMPOSITE -DHAVE_SW_SERIAL -DSS_TIMER=4 -DSTM32_FLASH_SIZE=512
346
-build_unflags     = -std=gnu++11
347
-lib_deps          = ${common.lib_deps}
348
-  SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
349
-lib_ignore        = Adafruit NeoPixel, SPI
350
-src_filter        = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
351
-monitor_speed     = 115200
277
+  ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4 -DSTM32_FLASH_SIZE=512 -DUSE_USB_COMPOSITE
352 278
 
353 279
 [env:STM32F103RE_bigtree]
354
-platform          = ststm32
355
-framework         = arduino
280
+extends           = env:STM32F1_base
356 281
 board             = genericSTM32F103RE
357 282
 board_upload.maximum_size=524288
358 283
 platform_packages = tool-stm32duino
359 284
 extra_scripts     = buildroot/share/PlatformIO/scripts/STM32F103RE_SKR_E3_DIP.py
360 285
 build_flags       = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
361 286
   ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DHAVE_SW_SERIAL -DSS_TIMER=4
362
-build_unflags     = -std=gnu++11
363 287
 lib_deps          = ${common.lib_deps}
364 288
   SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
365
-lib_ignore        = Adafruit NeoPixel, SPI
366 289
 src_filter        = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
367 290
 monitor_speed     = 115200
368 291
 
369 292
 [env:STM32F103RE_bigtree_USB]
370
-platform          = ststm32
371
-framework         = arduino
372
-board             = genericSTM32F103RE
373
-board_upload.maximum_size=524288
374
-platform_packages = tool-stm32duino
375
-extra_scripts     = buildroot/share/PlatformIO/scripts/STM32F103RE_SKR_E3_DIP.py
293
+extends           = env:STM32F103RE_bigtree
376 294
 build_flags       = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
377 295
   ${common.build_flags} -DDEBUG_LEVEL=0 -std=gnu++14 -DUSE_USB_COMPOSITE -DHAVE_SW_SERIAL -DSS_TIMER=4
378
-build_unflags     = -std=gnu++11
379
-lib_deps          = ${common.lib_deps}
380
-  SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
381
-lib_ignore        = Adafruit NeoPixel, SPI
382
-src_filter        = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
383
-monitor_speed     = 115200
384 296
 
385 297
 #
386 298
 # STM32F4 with STM32GENERIC
387 299
 #
388 300
 [env:STM32F4]
389 301
 platform      = ststm32
390
-framework     = arduino
391 302
 board         = disco_f407vg
392 303
 build_flags   = ${common.build_flags} -DUSE_STM32GENERIC -DSTM32GENERIC -DSTM32F4 -DMENU_USB_SERIAL -DMENU_SERIAL=SerialUSB -DHAL_IWDG_MODULE_ENABLED
393
-lib_deps      = ${common.lib_deps}
394 304
 lib_ignore    = Adafruit NeoPixel, TMCStepper
395 305
 src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32_F4_F7> -<src/HAL/HAL_STM32_F4_F7/STM32F7>
396 306
 monitor_speed = 250000
397 307
 
398 308
 #
399
-# FYSETC S6 (STM32F446VET6 ARM Cortex-M4)
400
-#
401
-[env:FYSETC_S6]
402
-platform          = ststm32
403
-framework         = arduino
404
-board             = fysetc_s6
405
-extra_scripts     = buildroot/share/PlatformIO/scripts/fysetc_STM32S6.py
406
-build_flags       = ${common.build_flags}
407
-  -DTARGET_STM32F4 -std=gnu++14
408
-  -DVECT_TAB_OFFSET=0x10000
409
-  -DUSBCON -DUSBD_USE_CDC -DHAL_PCD_MODULE_ENABLED -DUSBD_VID=0x0483 '-DUSB_PRODUCT="FYSETC_S6"'
410
-build_unflags     = -std=gnu++11
411
-lib_deps          = ${common.lib_deps}
412
-lib_ignore        = Arduino-L6470
413
-src_filter        = ${common.default_src_filter} +<src/HAL/HAL_STM32>
414
-monitor_speed     = 250000
415
-platform_packages = tool-stm32duino
416
-debug_tool        = stlink
417
-#upload_protocol   = stlink
418
-upload_protocol   = serial
419
-
420
-#
421 309
 # STM32F7 with STM32GENERIC
422 310
 #
423 311
 [env:STM32F7]
424 312
 platform      = ststm32
425
-framework     = arduino
426 313
 board         = remram_v1
427 314
 build_flags   = ${common.build_flags} -DUSE_STM32GENERIC -DSTM32GENERIC -DSTM32F7 -DMENU_USB_SERIAL -DMENU_SERIAL=SerialUSB -DHAL_IWDG_MODULE_ENABLED
428
-lib_deps      = ${common.lib_deps}
429 315
 lib_ignore    = Adafruit NeoPixel, TMCStepper
430 316
 src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32_F4_F7> -<src/HAL/HAL_STM32_F4_F7/STM32F4>
431 317
 monitor_speed = 250000
@@ -435,13 +321,11 @@ monitor_speed = 250000
435 321
 #
436 322
 [env:ARMED]
437 323
 platform      = ststm32
438
-framework     = arduino
439 324
 board         = armed_v1
440 325
 build_flags   = ${common.build_flags}
441 326
   -DUSBCON -DUSBD_VID=0x0483 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="ARMED_V1"' -DUSBD_USE_CDC
442 327
   -O2 -ffreestanding -fsigned-char -fno-move-loop-invariants -fno-strict-aliasing -std=gnu11 -std=gnu++11
443 328
   -IMarlin/src/HAL/HAL_STM32
444
-lib_deps      = ${common.lib_deps}
445 329
 lib_ignore    = Adafruit NeoPixel, SoftwareSerial
446 330
 src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32>
447 331
 monitor_speed = 250000
@@ -450,103 +334,115 @@ monitor_speed = 250000
450 334
 # Longer 3D board in Alfawise U20 (STM32F103VET6)
451 335
 #
452 336
 [env:STM32F103VE_longer]
453
-platform      = ststm32
454
-framework     = arduino
337
+extends       = env:STM32F1_base
455 338
 board         = genericSTM32F103VE
456
-monitor_speed = 250000
457 339
 extra_scripts = buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py
458 340
 build_flags   = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
459 341
   ${common.build_flags} -std=gnu++14 -USERIAL_USB
460 342
   -DSTM32F1xx -DU20 -DTS_V12
461 343
 build_unflags = -std=gnu++11 -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DERROR_LED_PORT=GPIOE -DERROR_LED_PIN=6
462
-src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
463
-lib_deps      = ${common.lib_deps}
464 344
 lib_ignore    = Adafruit NeoPixel, LiquidTWI2, SPI
465 345
 
466 346
 #
467 347
 # MKS Robin (STM32F103ZET6)
468 348
 #
469 349
 [env:mks_robin]
470
-platform      = ststm32
471
-framework     = arduino
350
+extends       = env:STM32F1_base
472 351
 board         = genericSTM32F103ZE
473 352
 extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin.py
474 353
 build_flags   = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
475 354
   ${common.build_flags} -std=gnu++14 -DSTM32_XL_DENSITY
476
-build_unflags = -std=gnu++11
477
-src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
478
-lib_deps      = ${common.lib_deps}
479
-lib_ignore    = Adafruit NeoPixel, SPI
480 355
 
481 356
 #
482 357
 # MKS ROBIN LITE/LITE2 (STM32F103RCT6)
483 358
 #
484 359
 [env:mks_robin_lite]
485
-platform      = ststm32
486
-framework     = arduino
360
+extends       = env:STM32F1_base
487 361
 board         = genericSTM32F103RC
488 362
 extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_lite.py
489
-build_flags   = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
490
-  ${common.build_flags} -std=gnu++14
491
-build_unflags = -std=gnu++11
492
-src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
493
-lib_deps      = ${common.lib_deps}
494
-lib_ignore    = Adafruit NeoPixel, SPI
495 363
 
496 364
 #
497 365
 # MKS Robin Mini (STM32F103VET6)
498 366
 #
499 367
 [env:mks_robin_mini]
500
-platform      = ststm32
501
-framework     = arduino
368
+extends       = env:STM32F1_base
502 369
 board         = genericSTM32F103VE
503 370
 extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_mini.py
504
-build_flags   = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
505
-  ${common.build_flags} -std=gnu++14
506
-build_unflags = -std=gnu++11
507
-src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
508
-lib_deps      = ${common.lib_deps}
509
-lib_ignore    = Adafruit NeoPixel, SPI
510 371
 
511 372
 #
512 373
 # MKS Robin Nano (STM32F103VET6)
513 374
 #
514 375
 [env:mks_robin_nano]
515
-platform      = ststm32
516
-framework     = arduino
376
+extends       = env:STM32F1_base
517 377
 board         = genericSTM32F103VE
518 378
 extra_scripts = buildroot/share/PlatformIO/scripts/mks_robin_nano.py
519
-build_flags   = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
520
-  ${common.build_flags} -std=gnu++14
521
-build_unflags = -std=gnu++11
522
-src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
523
-lib_deps      = ${common.lib_deps}
524
-lib_ignore    = Adafruit NeoPixel, SPI
525 379
 
526 380
 #
527 381
 # JGAurora A5S A1 (STM32F103ZET6)
528 382
 #
529 383
 [env:jgaurora_a5s_a1]
530
-platform      = ststm32
531
-framework     = arduino
384
+extends       = env:STM32F1_base
532 385
 board         = genericSTM32F103ZE
533 386
 extra_scripts = buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py
534 387
 build_flags   = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
535 388
   ${common.build_flags} -DSTM32F1xx -std=gnu++14 -DSTM32_XL_DENSITY
389
+
390
+#
391
+# Malyan M200 (STM32F103CB)
392
+#
393
+[env:STM32F103CB_malyan]
394
+platform    = ststm32
395
+board       = malyanM200
396
+build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py -DMCU_STM32F103CB -D __STM32F1__=1 -std=c++1y -D MOTHERBOARD="BOARD_MALYAN_M200" -DSERIAL_USB -ffunction-sections -fdata-sections -Wl,--gc-sections
397
+  -DDEBUG_LEVEL=0 -D__MARLIN_FIRMWARE__
398
+src_filter  = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
399
+lib_ignore  = Adafruit NeoPixel, LiquidCrystal, LiquidTWI2, TMCStepper, U8glib-HAL, SPI
400
+
401
+#
402
+# Chitu boards like Tronxy X5s (STM32F103ZET6)
403
+#
404
+[env:chitu_f103]
405
+extends       = env:STM32F1_base
406
+board         = genericSTM32F103ZE
407
+extra_scripts = buildroot/share/PlatformIO/scripts/chitu_crypt.py
408
+build_flags   = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
409
+  ${common.build_flags} -DSTM32F1xx -std=gnu++14 -DSTM32_XL_DENSITY
410
+build_unflags = -std=gnu++11 -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG= -DERROR_LED_PORT=GPIOE -DERROR_LED_PIN=6
411
+lib_ignore    = Adafruit NeoPixel
412
+
413
+#
414
+# STM32 HAL environments
415
+#
416
+[env:STM32_hal]
417
+platform      = ststm32
536 418
 build_unflags = -std=gnu++11
537
-src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
538
-lib_deps      = ${common.lib_deps}
539
-lib_ignore    = Adafruit NeoPixel, SPI
419
+src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32>
540 420
 monitor_speed = 250000
541 421
 
542 422
 #
423
+# FYSETC S6 (STM32F446VET6 ARM Cortex-M4)
424
+#
425
+[env:FYSETC_S6]
426
+extends           = env:STM32_hal
427
+board             = fysetc_s6
428
+extra_scripts     = buildroot/share/PlatformIO/scripts/fysetc_STM32S6.py
429
+build_flags       = ${common.build_flags}
430
+  -DTARGET_STM32F4 -std=gnu++14
431
+  -DVECT_TAB_OFFSET=0x10000
432
+  -DUSBCON -DUSBD_USE_CDC -DHAL_PCD_MODULE_ENABLED -DUSBD_VID=0x0483 '-DUSB_PRODUCT="FYSETC_S6"'
433
+lib_ignore        = Arduino-L6470
434
+platform_packages = tool-stm32duino
435
+debug_tool        = stlink
436
+#upload_protocol   = stlink
437
+upload_protocol   = serial
438
+
439
+#
543 440
 # STM32F407VET6 with RAMPS-like shield
544 441
 # 'Black' STM32F407VET6 board - http://wiki.stm32duino.com/index.php?title=STM32F407
545 442
 # Shield - https://github.com/jmz52/Hardware
546 443
 #
547 444
 [env:STM32F407VE_black]
548
-platform          = ststm32
549
-framework         = arduino
445
+extends           = env:STM32_hal
550 446
 platform_packages = framework-arduinoststm32@>=3.10700.191028
551 447
 board             = blackSTM32F407VET6
552 448
 extra_scripts     = pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
@@ -554,17 +450,13 @@ build_flags       = ${common.build_flags}
554 450
  -DTARGET_STM32F4 -DARDUINO_BLACK_F407VE
555 451
  -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -DUSB_PRODUCT=\"BLACK_F407VE\"
556 452
   -IMarlin/src/HAL/HAL_STM32
557
-lib_deps          = ${common.lib_deps}
558 453
 lib_ignore        = Adafruit NeoPixel, TMCStepper, SailfishLCD, SailfishRGB_LED, SlowSoftI2CMaster, SoftwareSerial
559
-src_filter        = ${common.default_src_filter} +<src/HAL/HAL_STM32>
560
-monitor_speed     = 250000
561 454
 
562 455
 #
563 456
 # Bigtreetech SKR Pro (STM32F407ZGT6 ARM Cortex-M4)
564 457
 #
565 458
 [env:BIGTREE_SKR_PRO]
566
-platform          = ststm32
567
-framework         = arduino
459
+extends           = env:STM32_hal
568 460
 platform_packages = framework-arduinoststm32@>=3.10700.191028
569 461
 board             = BigTree_SKR_Pro
570 462
 extra_scripts     = pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
@@ -581,15 +473,13 @@ lib_deps          =
581 473
   LiquidTWI2=https://github.com/lincomatic/LiquidTWI2/archive/master.zip
582 474
   Arduino-L6470=https://github.com/ameyer/Arduino-L6470/archive/dev.zip
583 475
 lib_ignore        = SoftwareSerial, SoftwareSerialM
584
-src_filter        = ${common.default_src_filter} +<src/HAL/HAL_STM32>
585
-monitor_speed     = 250000
586 476
 
587 477
 #
588 478
 # BIGTREE_SKR_BTT002 (STM32F407VET6 ARM Cortex-M4)
589 479
 #
590 480
 [env:BIGTREE_BTT002]
481
+extends       = env:STM32_hal
591 482
 platform      = ststm32@5.6.0
592
-framework     = arduino
593 483
 board         = BigTree_Btt002
594 484
 extra_scripts = pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
595 485
 build_flags   = ${common.build_flags}
@@ -599,19 +489,14 @@ build_flags   = ${common.build_flags}
599 489
   -DHAVE_HWSERIAL3
600 490
   -DPIN_SERIAL2_RX=PD_6
601 491
   -DPIN_SERIAL2_TX=PD_5
602
-lib_deps      = ${common.lib_deps}
603 492
 lib_ignore    = Adafruit NeoPixel, SailfishLCD, SailfishRGB_LED, SlowSoftI2CMaster
604
-src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32>
605
-monitor_speed = 250000
606 493
 
607 494
 #
608 495
 # Teensy 3.1 / 3.2 (ARM Cortex-M4)
609 496
 #
610 497
 [env:teensy31]
611 498
 platform      = teensy
612
-framework     = arduino
613 499
 board         = teensy31
614
-build_flags   = ${common.build_flags}
615 500
 lib_deps      = ${common.lib_deps}
616 501
   TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
617 502
 lib_ignore    = Adafruit NeoPixel
@@ -619,45 +504,12 @@ src_filter    = ${common.default_src_filter} +<src/HAL/HAL_TEENSY31_32>
619 504
 monitor_speed = 250000
620 505
 
621 506
 #
622
-# Malyan M200 (STM32F103CB)
623
-#
624
-[env:STM32F103CB_malyan]
625
-platform    = ststm32
626
-framework   = arduino
627
-board       = malyanM200
628
-build_flags = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py -DMCU_STM32F103CB -D __STM32F1__=1 -std=c++1y -D MOTHERBOARD="BOARD_MALYAN_M200" -DSERIAL_USB -ffunction-sections -fdata-sections -Wl,--gc-sections
629
-  -DDEBUG_LEVEL=0 -D__MARLIN_FIRMWARE__
630
-src_filter  = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
631
-lib_ignore  = Adafruit NeoPixel, LiquidCrystal, LiquidTWI2, TMCStepper, U8glib-HAL, SPI
632
-
633
-#
634
-# Chitu boards like Tronxy X5s (STM32F103ZET6)
635
-#
636
-[env:chitu_f103]
637
-platform      = ststm32
638
-framework     = arduino
639
-board         = genericSTM32F103ZE
640
-extra_scripts = buildroot/share/PlatformIO/scripts/chitu_crypt.py
641
-build_flags   = !python Marlin/src/HAL/HAL_STM32F1/build_flags.py
642
-  ${common.build_flags} -DSTM32F1xx -std=gnu++14 -DSTM32_XL_DENSITY
643
-build_unflags = -std=gnu++11 -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG= -DERROR_LED_PORT=GPIOE -DERROR_LED_PIN=6
644
-src_filter    = ${common.default_src_filter} +<src/HAL/HAL_STM32F1>
645
-lib_deps      = ${common.lib_deps}
646
-lib_ignore    = Adafruit NeoPixel
647
-
648
-#
649 507
 # Teensy 3.5 / 3.6 (ARM Cortex-M4)
650 508
 #
651 509
 [env:teensy35]
652
-platform      = teensy
653
-framework     = arduino
510
+extends       = env:teensy31
654 511
 board         = teensy35
655
-build_flags   = ${common.build_flags}
656
-lib_deps      = ${common.lib_deps}
657
-  TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
658
-lib_ignore    = Adafruit NeoPixel
659 512
 src_filter    = ${common.default_src_filter} +<src/HAL/HAL_TEENSY35_36>
660
-monitor_speed = 250000
661 513
 
662 514
 #
663 515
 # Espressif ESP32
@@ -665,7 +517,6 @@ monitor_speed = 250000
665 517
 [env:esp32]
666 518
 platform      = espressif32
667 519
 board         = esp32dev
668
-framework     = arduino
669 520
 upload_speed  = 115200
670 521
 monitor_speed = 115200
671 522
 upload_port   = /dev/ttyUSB0
@@ -676,25 +527,12 @@ lib_ignore    = LiquidCrystal, LiquidTWI2, SailfishLCD, SailfishRGB_LED
676 527
 src_filter    = ${common.default_src_filter} +<src/HAL/HAL_ESP32>
677 528
 
678 529
 #
679
-# FYSETC F6 V1.3
680
-#
681
-[env:fysetc_f6_13]
682
-platform          = atmelavr
683
-framework         = arduino
684
-board             = fysetc_f6_13
685
-build_flags       = ${common.build_flags}
686
-board_build.f_cpu = 16000000L
687
-lib_deps          = ${common.lib_deps}
688
-  TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
689
-src_filter        = ${common.default_src_filter} +<src/HAL/HAL_AVR>
690
-monitor_speed     = 250000
691
-
692
-#
693 530
 # Native
694 531
 # No supported Arduino libraries, base Marlin only
695 532
 #
696 533
 [env:linux_native]
697 534
 platform        = native
535
+framework       =
698 536
 build_flags     = -D__PLAT_LINUX__ -std=gnu++17 -ggdb -g -lrt -lpthread -D__MARLIN_FIRMWARE__ -Wno-expansion-to-defined
699 537
 src_build_flags = -Wall -IMarlin/src/HAL/HAL_LINUX/include
700 538
 build_unflags   = -Wall
@@ -709,11 +547,9 @@ src_filter      = ${common.default_src_filter} +<src/HAL/HAL_LINUX>
709 547
 [env:SAMD51_grandcentral_m4]
710 548
 platform      = atmelsam
711 549
 board         = adafruit_grandcentral_m4
712
-framework     = arduino
713 550
 build_flags   = ${common.build_flags} -std=gnu++17
714 551
 extra_scripts = ${common.extra_scripts}
715 552
 build_unflags = -std=gnu++11
716
-lib_deps      = ${common.lib_deps}
717 553
 src_filter    = ${common.default_src_filter} +<src/HAL/HAL_SAMD51>
718 554
 debug_tool    = jlink
719 555
 
@@ -722,7 +558,6 @@ debug_tool    = jlink
722 558
 #
723 559
 [env:include_tree]
724 560
 platform    = atmelavr
725
-framework   = arduino
726 561
 board       = megaatmega2560
727 562
 build_flags = -c -H -std=gnu++11 -Wall -Os -D__MARLIN_FIRMWARE__
728 563
 lib_deps    = ${common.lib_deps}

Loading…
Cancel
Save