Browse Source

Clean up envs / variants

Scott Lahteine 4 years ago
parent
commit
ea20c77df9

+ 0
- 2
buildroot/share/PlatformIO/scripts/STEVAL__F401XX.py View File

@@ -7,5 +7,3 @@ for i, flag in enumerate(env["LINKFLAGS"]):
7 7
         env["LINKFLAGS"][i] = "-Wl,-T" + custom_ld_script
8 8
     elif flag == "-T":
9 9
         env["LINKFLAGS"][i + 1] = custom_ld_script
10
-
11
-

buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP_create_variant.py → buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py View File


+ 4
- 7
buildroot/share/PlatformIO/variants/MEEB_3DP/variant.h View File

@@ -1,20 +1,17 @@
1
-#ifndef _VARIANT_ARDUINO_STM32_
2
-#define _VARIANT_ARDUINO_STM32_
1
+#pragma once
3 2
 
4 3
 #define digitalPinToPort(P)        ( PIN_MAP[P].gpio_device )
5 4
 #define digitalPinToBitMask(P)     ( BIT(PIN_MAP[P].gpio_bit) )
6 5
 #define portOutputRegister(port)   ( &(port->regs->ODR) )
7 6
 #define portInputRegister(port)    ( &(port->regs->IDR) )
8 7
 
9
-#define portSetRegister(pin)		( &(PIN_MAP[pin].gpio_device->regs->BSRR) )
10
-#define portClearRegister(pin)		( &(PIN_MAP[pin].gpio_device->regs->BRR) )
8
+#define portSetRegister(pin)       ( &(PIN_MAP[pin].gpio_device->regs->BSRR) )
9
+#define portClearRegister(pin)     ( &(PIN_MAP[pin].gpio_device->regs->BRR) )
11 10
 
12
-#define portConfigRegister(pin)		( &(PIN_MAP[pin].gpio_device->regs->CRL) )
11
+#define portConfigRegister(pin)    ( &(PIN_MAP[pin].gpio_device->regs->CRL) )
13 12
 
14 13
 static const uint8_t SS   = BOARD_SPI1_NSS_PIN;
15 14
 static const uint8_t SS1  = BOARD_SPI2_NSS_PIN;
16 15
 static const uint8_t MOSI = BOARD_SPI1_MOSI_PIN;
17 16
 static const uint8_t MISO = BOARD_SPI1_MISO_PIN;
18 17
 static const uint8_t SCK  = BOARD_SPI1_SCK_PIN;
19
-
20
-#endif /* _VARIANT_ARDUINO_STM32_ */

+ 153
- 103
platformio.ini View File

@@ -8,7 +8,7 @@
8 8
 #
9 9
 
10 10
 # Automatic targets - enable auto-uploading
11
-# targets = upload
11
+#targets = upload
12 12
 
13 13
 #
14 14
 # By default platformio build will abort after 5 errors.
@@ -20,6 +20,9 @@ src_dir      = Marlin
20 20
 boards_dir   = buildroot/share/PlatformIO/boards
21 21
 default_envs = mega2560
22 22
 
23
+#
24
+# The 'common' values are used for most Marlin builds
25
+#
23 26
 [common]
24 27
 default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
25 28
 extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py
@@ -35,44 +38,9 @@ lib_deps =
35 38
   SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip
36 39
   SlowSoftI2CMaster=https://github.com/mikeshub/SlowSoftI2CMaster/archive/master.zip
37 40
 
38
-# Common traits for environments using HAL/STM32
39
-[base_stm32]
40
-platform      = ststm32@<6.2.0
41
-platform_packages = framework-arduinoststm32@>=4.10700,<4.10800
42
-lib_deps      = ${common.lib_deps}
43
-lib_ignore    = SoftwareSerial
44
-build_flags   = ${common.build_flags}
45
-  -IMarlin/src/HAL/STM32 -std=gnu++14
46
-  -DUSBCON -DUSBD_USE_CDC
47
-build_unflags = -std=gnu++11
48
-src_filter    = ${common.default_src_filter} +<src/HAL/STM32>
49
-
50
-[common_stm32]
51
-platform      = ${base_stm32.platform}
52
-extends       = base_stm32
53
-build_flags   = ${base_stm32.build_flags} -DUSBD_VID=0x0483
54
-
55
-# Common traits for environments using HAL/STM32F1
56
-[common_stm32f1]
57
-platform      = ${common_stm32.platform}
58
-build_flags   = !python Marlin/src/HAL/STM32F1/build_flags.py
59
-  ${common.build_flags} -std=gnu++14 -DHAVE_SW_SERIAL
60
-build_unflags = -std=gnu++11
61
-src_filter    = ${common.default_src_filter} +<src/HAL/STM32F1>
62
-lib_ignore    =
63
-  Adafruit NeoPixel
64
-  SPI
65
-lib_deps      = ${common.lib_deps}
66
-  SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
67
-
68
-[common_avr8]
69
-board_build.f_cpu = 16000000L
70
-lib_deps          = ${common.lib_deps}
71
-  TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
72
-src_filter        = ${common.default_src_filter} +<src/HAL/AVR>
73
-
74
-# Globally defined properties
75
-# inherited by all environments
41
+#
42
+# Default values apply to all 'env:' prefixed environments
43
+#
76 44
 [env]
77 45
 framework     = arduino
78 46
 build_flags   = ${common.build_flags}
@@ -89,6 +57,21 @@ monitor_speed = 250000
89 57
 #                               #
90 58
 #################################
91 59
 
60
+#################################
61
+#                               #
62
+#       AVR Architecture        #
63
+#                               #
64
+#################################
65
+
66
+#
67
+# AVR (8-bit) Common Environment values
68
+#
69
+[common_avr8]
70
+board_build.f_cpu = 16000000L
71
+lib_deps          = ${common.lib_deps}
72
+  TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
73
+src_filter        = ${common.default_src_filter} +<src/HAL/AVR>
74
+
92 75
 #
93 76
 # ATmega2560
94 77
 #
@@ -206,6 +189,12 @@ lib_ignore    = TMCStepper
206 189
 platform      = teensy
207 190
 extends       = env:at90usb1286_cdc
208 191
 
192
+#################################
193
+#                               #
194
+#       DUE Architecture        #
195
+#                               #
196
+#################################
197
+
209 198
 #
210 199
 # Due (Atmel SAM3X8E ARM Cortex-M3)
211 200
 #
@@ -252,6 +241,32 @@ platform      = ${common_DUE_archim.platform}
252 241
 extends       = common_DUE_archim
253 242
 build_flags   = ${common_DUE_archim.build_flags} -funwind-tables -mpoke-function-name
254 243
 
244
+#################################
245
+#                               #
246
+#      SAMD51 Architecture      #
247
+#                               #
248
+#################################
249
+
250
+#
251
+# Adafruit Grand Central M4 (Atmel SAMD51P20A ARM Cortex-M4)
252
+#
253
+[env:SAMD51_grandcentral_m4]
254
+platform       = atmelsam
255
+board          = adafruit_grandcentral_m4
256
+build_flags    = ${common.build_flags} -std=gnu++17 -Wno-register
257
+build_unflags  = -std=gnu++11
258
+src_filter     = ${common.default_src_filter} +<src/HAL/SAMD51>
259
+lib_deps       = ${common.lib_deps}
260
+  SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
261
+  Adafruit_SPIFlash=https://github.com/adafruit/Adafruit_SPIFlash/archive/master.zip
262
+debug_tool     = jlink
263
+
264
+#################################
265
+#                               #
266
+#     LPC176x Architecture      #
267
+#                               #
268
+#################################
269
+
255 270
 #
256 271
 # NXP LPC176x ARM Cortex-M3
257 272
 #
@@ -286,6 +301,49 @@ platform  = ${common_LPC.platform}
286 301
 extends   = common_LPC
287 302
 board     = nxp_lpc1769
288 303
 
304
+#################################
305
+#                               #
306
+#      STM32 Architecture       #
307
+#                               #
308
+#################################
309
+
310
+#
311
+# HAL/STM32 Base Environment values
312
+#
313
+[base_stm32]
314
+platform      = ststm32@<6.2.0
315
+platform_packages = framework-arduinoststm32@>=4.10700,<4.10800
316
+lib_deps      = ${common.lib_deps}
317
+lib_ignore    = SoftwareSerial
318
+build_flags   = ${common.build_flags}
319
+  -IMarlin/src/HAL/STM32 -std=gnu++14
320
+  -DUSBCON -DUSBD_USE_CDC
321
+build_unflags = -std=gnu++11
322
+src_filter    = ${common.default_src_filter} +<src/HAL/STM32>
323
+
324
+#
325
+# HAL/STM32 Common Environment values
326
+#
327
+[common_stm32]
328
+platform      = ${base_stm32.platform}
329
+extends       = base_stm32
330
+build_flags   = ${base_stm32.build_flags} -DUSBD_VID=0x0483
331
+
332
+#
333
+# HAL/STM32F1 Common Environment values
334
+#
335
+[common_stm32f1]
336
+platform      = ${common_stm32.platform}
337
+build_flags   = !python Marlin/src/HAL/STM32F1/build_flags.py
338
+  ${common.build_flags} -std=gnu++14 -DHAVE_SW_SERIAL
339
+build_unflags = -std=gnu++11
340
+src_filter    = ${common.default_src_filter} +<src/HAL/STM32F1>
341
+lib_ignore    =
342
+  Adafruit NeoPixel
343
+  SPI
344
+lib_deps      = ${common.lib_deps}
345
+  SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
346
+
289 347
 #
290 348
 # STM32F103RC
291 349
 #
@@ -312,7 +370,7 @@ build_flags       = ${common_stm32f1.build_flags}
312 370
                     -DUSE_USB_COMPOSITE
313 371
                     -DVECT_TAB_OFFSET=0x2000
314 372
                     -DGENERIC_BOOTLOADER
315
-extra_scripts     = pre:buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP_create_variant.py
373
+extra_scripts     = pre:buildroot/share/PlatformIO/scripts/STM32F1_create_variant.py
316 374
     buildroot/share/PlatformIO/scripts/STM32F103RC_MEEB_3DP.py
317 375
 lib_deps          = ${common_stm32f1.lib_deps}
318 376
     USBComposite for STM32F1@==0.91
@@ -702,26 +760,43 @@ extra_scripts     = pre:buildroot/share/PlatformIO/scripts/generic_create_varian
702 760
 lib_ignore        = Adafruit NeoPixel, SailfishLCD, SlowSoftI2CMaster, SoftwareSerial
703 761
 
704 762
 #
705
-# Teensy 3.1 / 3.2 (ARM Cortex-M4)
763
+# RUMBA32
706 764
 #
707
-[env:teensy31]
708
-platform      = teensy
709
-board         = teensy31
710
-lib_deps      = ${common.lib_deps}
711
-  TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
712
-lib_ignore    = Adafruit NeoPixel
713
-src_filter    = ${common.default_src_filter} +<src/HAL/TEENSY31_32>
765
+
766
+[common_rumba32]
767
+platform      = ${base_stm32.platform}
768
+extends       = base_stm32
769
+build_flags   = ${base_stm32.build_flags} -Os
770
+  -DSTM32F4xx -DARDUINO_RUMBA32_F446VE -DARDUINO_ARCH_STM32 "-DBOARD_NAME=\"RUMBA32_F446VE\""
771
+  -DSTM32F446xx "-DUSB_PRODUCT=\"RUMBA32_F446VE\""
772
+  -DHAL_PCD_MODULE_ENABLED
773
+  -DDISABLE_GENERIC_SERIALUSB
774
+  -DHAL_UART_MODULE_ENABLED
775
+board         = rumba32_f446ve
776
+upload_protocol = dfu
777
+monitor_speed = 500000
714 778
 
715 779
 #
716
-# Teensy 3.5 / 3.6 (ARM Cortex-M4)
780
+# RUMBA32 F446VE
717 781
 #
718
-[env:teensy35]
719
-platform      = teensy
720
-board         = teensy35
721
-lib_deps      = ${common.lib_deps}
722
-  TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
723
-lib_ignore    = Adafruit NeoPixel
724
-src_filter    = ${common.default_src_filter} +<src/HAL/TEENSY35_36>
782
+[env:rumba32_f446ve]
783
+platform      = ${common_rumba32.platform}
784
+extends       = common_rumba32
785
+build_flags   = ${common_rumba32.build_flags} -DUSBD_VID=0x0483
786
+
787
+#
788
+# MKS RUMBA32 (adds TMC2208/2209 UART interface and AUX-1)
789
+#
790
+[env:rumba32_mks]
791
+platform      = ${common_rumba32.platform}
792
+extends       = common_rumba32
793
+build_flags   = ${common_rumba32.build_flags} -DUSBD_VID=0x8000
794
+
795
+#################################
796
+#                               #
797
+#      Other Architectures      #
798
+#                               #
799
+#################################
725 800
 
726 801
 #
727 802
 # Espressif ESP32
@@ -743,6 +818,28 @@ upload_speed  = 115200
743 818
 #board_build.flash_mode = qio
744 819
 
745 820
 #
821
+# Teensy 3.1 / 3.2 (ARM Cortex-M4)
822
+#
823
+[env:teensy31]
824
+platform      = teensy
825
+board         = teensy31
826
+lib_deps      = ${common.lib_deps}
827
+  TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
828
+lib_ignore    = Adafruit NeoPixel
829
+src_filter    = ${common.default_src_filter} +<src/HAL/TEENSY31_32>
830
+
831
+#
832
+# Teensy 3.5 / 3.6 (ARM Cortex-M4)
833
+#
834
+[env:teensy35]
835
+platform      = teensy
836
+board         = teensy35
837
+lib_deps      = ${common.lib_deps}
838
+  TMC26XStepper=https://github.com/trinamic/TMC26XStepper/archive/master.zip
839
+lib_ignore    = Adafruit NeoPixel
840
+src_filter    = ${common.default_src_filter} +<src/HAL/TEENSY35_36>
841
+
842
+#
746 843
 # Native
747 844
 # No supported Arduino libraries, base Marlin only
748 845
 #
@@ -757,53 +854,6 @@ lib_deps        =
757 854
 src_filter      = ${common.default_src_filter} +<src/HAL/LINUX>
758 855
 
759 856
 #
760
-# Adafruit Grand Central M4 (Atmel SAMD51P20A ARM Cortex-M4)
761
-#
762
-[env:SAMD51_grandcentral_m4]
763
-platform       = atmelsam
764
-board          = adafruit_grandcentral_m4
765
-build_flags    = ${common.build_flags} -std=gnu++17 -Wno-register
766
-build_unflags  = -std=gnu++11
767
-src_filter     = ${common.default_src_filter} +<src/HAL/SAMD51>
768
-lib_deps       = ${common.lib_deps}
769
-  SoftwareSerialM=https://github.com/FYSETC/SoftwareSerialM/archive/master.zip
770
-  Adafruit_SPIFlash=https://github.com/adafruit/Adafruit_SPIFlash/archive/master.zip
771
-debug_tool     = jlink
772
-
773
-#
774
-# RUMBA32
775
-#
776
-
777
-[common_rumba32]
778
-platform      = ${base_stm32.platform}
779
-extends       = base_stm32
780
-build_flags   = ${base_stm32.build_flags} -Os
781
-  -DSTM32F4xx -DARDUINO_RUMBA32_F446VE -DARDUINO_ARCH_STM32 "-DBOARD_NAME=\"RUMBA32_F446VE\""
782
-  -DSTM32F446xx "-DUSB_PRODUCT=\"RUMBA32_F446VE\""
783
-  -DHAL_PCD_MODULE_ENABLED
784
-  -DDISABLE_GENERIC_SERIALUSB
785
-  -DHAL_UART_MODULE_ENABLED
786
-board         = rumba32_f446ve
787
-upload_protocol = dfu
788
-monitor_speed = 500000
789
-
790
-#
791
-# RUMBA32 F446VE
792
-#
793
-[env:rumba32_f446ve]
794
-platform      = ${common_rumba32.platform}
795
-extends       = common_rumba32
796
-build_flags   = ${common_rumba32.build_flags} -DUSBD_VID=0x0483
797
-
798
-#
799
-# MKS RUMBA32 (adds TMC2208/2209 UART interface and AUX-1)
800
-#
801
-[env:rumba32_mks]
802
-platform      = ${common_rumba32.platform}
803
-extends       = common_rumba32
804
-build_flags   = ${common_rumba32.build_flags} -DUSBD_VID=0x8000
805
-
806
-#
807 857
 # Just print the dependency tree
808 858
 #
809 859
 [env:include_tree]

Loading…
Cancel
Save