Browse Source

♻️ Refactor STM32 ini files (#22377)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
Katelyn Schiesser 2 years ago
parent
commit
da0450605a
No account linked to committer's email address

+ 1
- 1
buildroot/share/PlatformIO/boards/marlin_STEVAL_STM32F401VE.json View File

@@ -2,7 +2,7 @@
2 2
   "build": {
3 3
     "core": "stm32",
4 4
     "cpu": "cortex-m4",
5
-    "extra_flags": "-DSTM32F401xx",
5
+    "extra_flags": "-DSTM32F401xx -DARDUINO_STEVAL",
6 6
     "f_cpu": "84000000L",
7 7
     "hwids": [
8 8
       [

+ 1
- 1
buildroot/share/PlatformIO/boards/marlin_blackSTM32F407VET6.json View File

@@ -2,7 +2,7 @@
2 2
   "build": {
3 3
     "core": "stm32",
4 4
     "cpu": "cortex-m4",
5
-    "extra_flags": "-DSTM32F407xx",
5
+    "extra_flags": "-DSTM32F407xx -DARDUINO_BLACK_F407VE",
6 6
     "f_cpu": "168000000L",
7 7
     "hwids": [
8 8
       [

+ 41
- 0
ini/stm32-common.ini View File

@@ -0,0 +1,41 @@
1
+#
2
+# Marlin Firmware
3
+# PlatformIO Configuration File
4
+#
5
+
6
+####################################
7
+#
8
+# HAL/STM32 Common Environments
9
+#
10
+####################################
11
+
12
+[common_stm32]
13
+platform         = ststm32@~12.1
14
+board_build.core = stm32
15
+build_flags      = ${common.build_flags}
16
+                   -std=gnu++14
17
+                   -DUSBCON -DUSBD_USE_CDC
18
+                   -DTIM_IRQ_PRIO=13
19
+                   -DADC_RESOLUTION=12
20
+build_unflags    = -std=gnu++11
21
+src_filter       = ${common.default_src_filter} +<src/HAL/STM32> +<src/HAL/shared/backtrace>
22
+extra_scripts    = ${common.extra_scripts}
23
+                   pre:buildroot/share/PlatformIO/scripts/stm32_serialbuffer.py
24
+
25
+#
26
+# STM32 board based on a variant.
27
+#
28
+[stm32_variant]
29
+extends       = common_stm32
30
+extra_scripts = ${common_stm32.extra_scripts}
31
+                pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
32
+                buildroot/share/PlatformIO/scripts/offset_and_rename.py
33
+
34
+#
35
+# USB Flash Drive mix-ins for STM32
36
+#
37
+[stm_flash_drive]
38
+platform_packages = framework-arduinoststm32@https://github.com/rhapsodyv/Arduino_Core_STM32/archive/usb-host-msc-cdc-msc-3.zip
39
+build_flags       = ${common_stm32.build_flags}
40
+                    -DHAL_PCD_MODULE_ENABLED -DHAL_HCD_MODULE_ENABLED
41
+                    -DUSBHOST -DUSBH_IRQ_PRIO=3 -DUSBH_IRQ_SUBPRIO=4

+ 6
- 4
ini/stm32f0.ini View File

@@ -27,8 +27,8 @@ platform    = ${common_stm32.platform}
27 27
 extends     = common_stm32
28 28
 board       = marlin_malyanM200v2
29 29
 build_flags = ${common_stm32.build_flags} -DHAL_PCD_MODULE_ENABLED
30
-  -O2 -ffreestanding -fsigned-char -fno-move-loop-invariants -fno-strict-aliasing
31
-  -DCUSTOM_STARTUP_FILE
30
+              -O2 -ffreestanding -fsigned-char -fno-move-loop-invariants
31
+              -fno-strict-aliasing -DCUSTOM_STARTUP_FILE
32 32
 
33 33
 #
34 34
 # Malyan M200 v2 (STM32F070CB)
@@ -38,7 +38,8 @@ platform    = ${common_stm32.platform}
38 38
 extends     = common_stm32
39 39
 board       = malyanm200_f070cb
40 40
 build_flags = ${common_stm32.build_flags}
41
-  -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED -DCUSTOM_STARTUP_FILE
41
+              -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB
42
+              -DHAL_UART_MODULE_ENABLED -DCUSTOM_STARTUP_FILE
42 43
 
43 44
 #
44 45
 # Malyan M300 (STM32F070CB)
@@ -48,5 +49,6 @@ platform    = ${common_stm32.platform}
48 49
 extends     = common_stm32
49 50
 board       = malyanm300_f070cb
50 51
 build_flags = ${common_stm32.build_flags}
51
-  -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED
52
+              -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB
53
+              -DHAL_UART_MODULE_ENABLED
52 54
 src_filter  = ${common.default_src_filter} +<src/HAL/STM32>

+ 179
- 213
ini/stm32f1.ini View File

@@ -10,70 +10,48 @@
10 10
 # Naming Example: STM32F103RCT6
11 11
 #
12 12
 #   F : Foundation (sometimes High Performance F2/F4)
13
-#   1 : Cortex M1 core
13
+#   1 : Cortex M3 core
14 14
 #  03 : Line/Features
15
-#   R : 64 or 66 pins  (V:100, Z:144, I:176)
16
-#   C : 256KB Flash-memory  (D:384KB, E:512KB, G:1024KB)
15
+#   R : 64 or 66 pins  (T:36, C:48, V:100, Z:144, I:176)
16
+#   C : 256KB Flash-memory  (B: 128KB, D:384KB, E:512KB, G:1024KB)
17 17
 #   T : LQFP package
18 18
 #   6 : -40...85°C   (7: ...105°C)
19 19
 #
20 20
 #################################
21 21
 
22
-#
23
-# HAL/STM32 Base Environment values
24
-#
25
-[common_stm32]
26
-platform      = ststm32@~12.1
27
-build_flags   = ${common.build_flags}
28
-  -std=gnu++14
29
-  -DUSBCON -DUSBD_USE_CDC
30
-  -DTIM_IRQ_PRIO=13
31
-  -DADC_RESOLUTION=12
32
-build_unflags = -std=gnu++11
33
-src_filter    = ${common.default_src_filter} +<src/HAL/STM32> +<src/HAL/shared/backtrace>
34
-extra_scripts = ${common.extra_scripts}
35
-  pre:buildroot/share/PlatformIO/scripts/stm32_serialbuffer.py
36
-
37
-[stm32f1_variant]
38
-extra_scripts        = ${common_stm32.extra_scripts}
39
-  pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
40
-  buildroot/share/PlatformIO/scripts/offset_and_rename.py
41
-
42
-[common_STM32F103RC]
43
-platform             = ${common_stm32.platform}
44
-extends              = common_stm32
22
+[common_STM32F103RC_variant]
23
+extends              = stm32_variant
45 24
 board                = genericSTM32F103RC
46
-monitor_speed        = 115200
47
-board_build.core     = stm32
48 25
 board_build.variant  = MARLIN_F103Rx
49
-extra_scripts        = ${stm32f1_variant.extra_scripts}
26
+build_flags          = ${stm32_variant.build_flags} -DDEBUG_LEVEL=0
27
+monitor_speed        = 115200
50 28
 
51 29
 #
52 30
 # STM32F103RE
53 31
 #
54 32
 [env:STM32F103RE]
55
-platform          = ${common_stm32.platform}
56
-extends           = common_stm32
57
-board             = genericSTM32F103RE
58
-monitor_speed     = 115200
33
+platform      = ${common_stm32.platform}
34
+extends       = common_stm32
35
+board         = genericSTM32F103RE
36
+monitor_speed = 115200
59 37
 
60 38
 #
61 39
 # STM32F103VE
62 40
 #
63 41
 [env:STM32F103VE]
64
-platform          = ${common_stm32.platform}
65
-extends           = common_stm32
66
-board             = genericSTM32F103VE
67
-monitor_speed     = 115200
42
+platform      = ${common_stm32.platform}
43
+extends       = common_stm32
44
+board         = genericSTM32F103VE
45
+monitor_speed = 115200
68 46
 
69 47
 #
70 48
 # STM32F103ZE
71 49
 #
72 50
 [env:STM32F103ZE]
73
-platform          = ${common_stm32.platform}
74
-extends           = common_stm32
75
-board             = genericSTM32F103ZE
76
-monitor_speed     = 115200
51
+platform      = ${common_stm32.platform}
52
+extends       = common_stm32
53
+board         = genericSTM32F103ZE
54
+monitor_speed = 115200
77 55
 
78 56
 #
79 57
 # BigTree SKR Mini V1.1 / SKR Mini E3 & MZ (STM32F103RCT6 ARM Cortex-M3)
@@ -82,23 +60,23 @@ monitor_speed     = 115200
82 60
 #   STM32F103RC_btt_USB ......... RCT6 with 256K (USB mass storage)
83 61
 #
84 62
 [env:STM32F103RC_btt]
85
-platform             = ${common_stm32.platform}
86
-extends              = common_STM32F103RC
87
-build_flags          = ${common_stm32.build_flags} -DDEBUG_LEVEL=0 -DTIMER_SERVO=TIM5
88
-board_build.offset   = 0x7000
63
+platform                    = ${common_stm32.platform}
64
+extends                     = common_STM32F103RC_variant
65
+build_flags                 = ${common_STM32F103RC_variant.build_flags}
66
+                              -DTIMER_SERVO=TIM5
67
+board_build.offset          = 0x7000
89 68
 board_upload.offset_address = 0x08007000
90 69
 
91 70
 [env:STM32F103RC_btt_USB]
92
-extends           = env:STM32F103RC_btt
93 71
 platform          = ${common_stm32.platform}
94
-platform_packages = framework-arduinoststm32@https://github.com/rhapsodyv/Arduino_Core_STM32/archive/usb-host-msc-cdc-msc-3.zip
72
+extends           = env:STM32F103RC_btt
73
+platform_packages = ${stm_flash_drive.platform_packages}
74
+build_flags       = ${env:STM32F103RC_btt.build_flags}
75
+                    -DUSE_USB_FS
76
+                    -DUSBD_IRQ_PRIO=5
77
+                    -DUSBD_IRQ_SUBPRIO=6
78
+                    -DUSBD_USE_CDC_MSC
95 79
 build_unflags     = ${common_stm32.build_unflags} -DUSBD_USE_CDC
96
-build_flags       = ${env:STM32F103RC_btt.build_flags} ${env:stm32_flash_drive.build_flags}
97
-  -DUSBCON
98
-  -DUSE_USB_FS
99
-  -DUSBD_IRQ_PRIO=5
100
-  -DUSBD_IRQ_SUBPRIO=6
101
-  -DUSBD_USE_CDC_MSC
102 80
 
103 81
 #
104 82
 # MKS Robin (STM32F103ZET6)
@@ -106,52 +84,53 @@ build_flags       = ${env:STM32F103RC_btt.build_flags} ${env:stm32_flash_drive.b
106 84
 #
107 85
 [env:mks_robin]
108 86
 platform             = ${common_stm32.platform}
109
-extends              = common_stm32
87
+extends              = stm32_variant
110 88
 board                = genericSTM32F103ZE
111
-board_build.core     = stm32
112 89
 board_build.variant  = MARLIN_F103Zx
113
-board_build.offset   = 0x7000
114 90
 board_build.encrypt  = Robin.bin
115
-build_flags          = ${common_stm32.build_flags}
116
-  -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5
117
-build_unflags        = ${common_stm32.build_unflags}
118
- -DUSBCON -DUSBD_USE_CDC
119
-extra_scripts        = ${stm32f1_variant.extra_scripts}
120
-lib_deps             =
91
+board_build.offset   = 0x7000
92
+build_flags          = ${stm32_variant.build_flags}
93
+                       -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5
94
+build_unflags        = ${stm32_variant.build_unflags}
95
+                       -DUSBCON -DUSBD_USE_CDC
121 96
 
122 97
 #
123 98
 # MKS Robin E3/E3D (STM32F103RCT6) with TMC2209
124 99
 #
125 100
 [env:mks_robin_e3]
126 101
 platform                    = ${common_stm32.platform}
127
-extends                     = common_STM32F103RC
128
-build_flags                 = ${common_stm32.build_flags} -DDEBUG_LEVEL=0 -DTIMER_SERVO=TIM5 -DDEFAULT_SPI=3
129
-build_unflags               = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
130
-monitor_speed               = 115200
131
-board_build.offset          = 0x5000
102
+extends                     = common_STM32F103RC_variant
132 103
 board_build.encrypt         = Robin_e3.bin
104
+board_build.offset          = 0x5000
133 105
 board_upload.offset_address = 0x08005000
106
+build_flags                 = ${common_STM32F103RC_variant.build_flags}
107
+                              -DTIMER_SERVO=TIM5 -DDEFAULT_SPI=3
108
+build_unflags               = ${common_STM32F103RC_variant.build_unflags}
109
+                              -DUSBCON -DUSBD_USE_CDC
110
+monitor_speed               = 115200
134 111
 debug_tool                  = stlink
135
-extra_scripts               = ${common_STM32F103RC.extra_scripts}
136 112
 
137 113
 #
138 114
 # Creality (STM32F103RET6)
139 115
 #
140 116
 [env:STM32F103RET6_creality]
141
-platform             = ${common_stm32.platform}
142
-extends              = common_stm32
143
-build_flags          = ${common_stm32.build_flags} -DMCU_STM32F103RE -DHAL_SD_MODULE_ENABLED -DSS_TIMER=4 -DTIMER_SERVO=TIM5 -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8
144
-board                = genericSTM32F103RE
145
-monitor_speed        = 115200
146
-board_build.core     = stm32
147
-board_build.variant  = MARLIN_F103Rx
148
-board_build.offset   = 0x7000
117
+platform                    = ${common_stm32.platform}
118
+extends                     = stm32_variant
119
+board                       = genericSTM32F103RE
120
+board_build.variant         = MARLIN_F103Rx
121
+board_build.offset          = 0x7000
149 122
 board_upload.offset_address = 0x08007000
150
-build_unflags        = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
151
-extra_scripts        = ${stm32f1_variant.extra_scripts}
152
-  pre:buildroot/share/PlatformIO/scripts/random-bin.py
153
-debug_tool           = jlink
154
-upload_protocol      = jlink
123
+build_flags                 = ${stm32_variant.build_flags}
124
+                              -DMCU_STM32F103RE -DHAL_SD_MODULE_ENABLED
125
+                              -DSS_TIMER=4 -DTIMER_SERVO=TIM5
126
+                              -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8
127
+build_unflags               = ${stm32_variant.build_unflags}
128
+                              -DUSBCON -DUSBD_USE_CDC
129
+extra_scripts               = ${stm32_variant.extra_scripts}
130
+                              pre:buildroot/share/PlatformIO/scripts/random-bin.py
131
+monitor_speed               = 115200
132
+debug_tool                  = jlink
133
+upload_protocol             = jlink
155 134
 
156 135
 #
157 136
 # BigTree SKR Mini E3 V2.0 & DIP / SKR CR6 (STM32F103RET6 ARM Cortex-M3)
@@ -160,80 +139,79 @@ upload_protocol      = jlink
160 139
 #   STM32F103RE_btt_USB ......... RET6 (USB mass storage)
161 140
 #
162 141
 [env:STM32F103RE_btt]
163
-platform             = ${common_stm32.platform}
164
-extends              = common_stm32
165
-build_flags          = ${common_stm32.build_flags} -DMCU_STM32F103RE -DHAL_SD_MODULE_ENABLED -DSS_TIMER=4 -DTIMER_SERVO=TIM5 -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8
166
-board                = genericSTM32F103RE
167
-monitor_speed        = 115200
168
-board_build.core     = stm32
169
-board_build.variant  = MARLIN_F103Rx
170
-board_build.offset   = 0x7000
142
+platform                    = ${common_stm32.platform}
143
+extends                     = stm32_variant
144
+board                       = genericSTM32F103RE
145
+board_build.variant         = MARLIN_F103Rx
146
+board_build.offset          = 0x7000
171 147
 board_upload.offset_address = 0x08007000
172
-build_unflags        = ${common_stm32.build_unflags}
173
-extra_scripts        = ${stm32f1_variant.extra_scripts}
174
-debug_tool           = jlink
175
-upload_protocol      = jlink
148
+build_flags                 = ${stm32_variant.build_flags}
149
+                              -DMCU_STM32F103RE -DHAL_SD_MODULE_ENABLED
150
+                              -DSS_TIMER=4 -DTIMER_SERVO=TIM5
151
+                              -DENABLE_HWSERIAL3 -DTRANSFER_CLOCK_DIV=8
152
+monitor_speed               = 115200
153
+debug_tool                  = jlink
154
+upload_protocol             = jlink
176 155
 
177 156
 [env:STM32F103RE_btt_USB]
178
-extends           = env:STM32F103RE_btt
179 157
 platform          = ${common_stm32.platform}
180
-platform_packages = framework-arduinoststm32@https://github.com/rhapsodyv/Arduino_Core_STM32/archive/usb-host-msc-cdc-msc-3.zip
181
-build_unflags     = ${common_stm32.build_unflags} -DUSBD_USE_CDC
182
-build_flags       = ${env:STM32F103RE_btt.build_flags} ${env:stm32_flash_drive.build_flags}
183
-  -DUSBCON
184
-  -DUSE_USB_FS
185
-  -DUSBD_IRQ_PRIO=5
186
-  -DUSBD_IRQ_SUBPRIO=6
187
-  -DUSBD_USE_CDC_MSC
158
+extends           = env:STM32F103RE_btt
159
+platform_packages = ${stm_flash_drive.platform_packages}
160
+build_flags       = ${env:STM32F103RE_btt.build_flags}
161
+                    -DUSE_USB_FS -DUSBD_IRQ_PRIO=5
162
+                    -DUSBD_IRQ_SUBPRIO=6 -DUSBD_USE_CDC_MSC
163
+build_unflags     = ${stm32_variant.build_unflags} -DUSBD_USE_CDC
188 164
 
189 165
 #
190 166
 # FLSUN QQS Pro (STM32F103VET6)
191 167
 # board Hispeedv1
192 168
 #
193 169
 [env:flsun_hispeedv1]
194
-platform             = ${common_stm32.platform}
195
-extends              = common_stm32
196
-build_flags          = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 -DENABLE_HWSERIAL3 -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2
197
-board                = genericSTM32F103VE
198
-board_build.core     = stm32
199
-board_build.variant  = MARLIN_F103Vx
200
-board_build.offset   = 0x7000
201
-board_build.encrypt  = Robin_mini.bin
170
+platform                    = ${common_stm32.platform}
171
+extends                     = stm32_variant
172
+board                       = genericSTM32F103VE
173
+board_build.variant         = MARLIN_F103Vx
174
+board_build.encrypt         = Robin_mini.bin
175
+board_build.offset          = 0x7000
202 176
 board_upload.offset_address = 0x08007000
203
-build_unflags        = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
204
-extra_scripts        = ${stm32f1_variant.extra_scripts}
177
+build_flags                 = ${stm32_variant.build_flags}
178
+                              -DMCU_STM32F103VE -DSS_TIMER=4 -DENABLE_HWSERIAL3
179
+                              -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2
180
+build_unflags               = ${stm32_variant.build_unflags}
181
+                              -DUSBCON -DUSBD_USE_CDC
205 182
 
206 183
 #
207 184
 # MKS Robin Nano V1.2 and V2
208 185
 #
209 186
 [env:mks_robin_nano35]
210
-platform             = ${common_stm32.platform}
211
-extends              = common_stm32
212
-build_flags          = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 -DENABLE_HWSERIAL3 -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2
213
-board                = genericSTM32F103VE
214
-board_build.core     = stm32
215
-board_build.variant  = MARLIN_F103Vx
216
-board_build.offset   = 0x7000
217
-board_build.encrypt  = Robin_nano35.bin
187
+platform                    = ${common_stm32.platform}
188
+extends                     = stm32_variant
189
+board                       = genericSTM32F103VE
190
+board_build.variant         = MARLIN_F103Vx
191
+board_build.encrypt         = Robin_nano35.bin
192
+board_build.offset          = 0x7000
218 193
 board_upload.offset_address = 0x08007000
219
-build_unflags        = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
220
-debug_tool           = jlink
221
-upload_protocol      = jlink
222
-extra_scripts        = ${stm32f1_variant.extra_scripts}
194
+build_flags                 = ${stm32_variant.build_flags}
195
+                              -DMCU_STM32F103VE -DSS_TIMER=4 -DENABLE_HWSERIAL3
196
+                              -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2
197
+build_unflags               = ${stm32_variant.build_unflags}
198
+                              -DUSBCON -DUSBD_USE_CDC
199
+debug_tool                  = jlink
200
+upload_protocol             = jlink
223 201
 
224 202
 #
225 203
 # Mingda MPX_ARM_MINI
226 204
 #
227 205
 [env:mingda_mpx_arm_mini]
228 206
 platform             = ${common_stm32.platform}
229
-extends              = common_stm32
207
+extends              = stm32_variant
230 208
 board                = genericSTM32F103ZE
231
-board_build.core     = stm32
232 209
 board_build.variant  = MARLIN_F103Zx
233 210
 board_build.offset   = 0x10000
234
-build_flags          = ${common_stm32.build_flags} -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5
235
-build_unflags        = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
236
-extra_scripts        = ${stm32f1_variant.extra_scripts}
211
+build_flags          = ${stm32_variant.build_flags}
212
+                       -DENABLE_HWSERIAL3 -DTIMER_SERIAL=TIM5
213
+build_unflags        = ${stm32_variant.build_unflags}
214
+                       -DUSBCON -DUSBD_USE_CDC
237 215
 
238 216
 #
239 217
 # Malyan M200 (STM32F103CB)
@@ -243,67 +221,55 @@ platform    = ${common_stm32.platform}
243 221
 extends     = common_stm32
244 222
 board       = malyanm200_f103cb
245 223
 build_flags = ${common_stm32.build_flags}
246
-  -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED
224
+              -DHAL_PCD_MODULE_ENABLED -DDISABLE_GENERIC_SERIALUSB
225
+              -DHAL_UART_MODULE_ENABLED
247 226
 src_filter  = ${common.default_src_filter} +<src/HAL/STM32>
248 227
 
249 228
 #
250 229
 # FLYmaker FLY Mini (STM32F103RCT6)
251 230
 #
252 231
 [env:FLY_MINI]
253
-platform             = ${common_stm32.platform}
254
-extends              = common_stm32
255
-build_flags          = ${common_stm32.build_flags} -DSS_TIMER=4
256
-board                = genericSTM32F103RC
257
-board_build.core     = stm32
258
-board_build.variant  = MARLIN_F103Rx
259
-board_build.offset   = 0x5000
232
+platform                    = ${common_stm32.platform}
233
+extends                     = stm32_variant
234
+board                       = genericSTM32F103RC
235
+board_build.variant         = MARLIN_F103Rx
236
+board_build.offset          = 0x5000
260 237
 board_upload.offset_address = 0x08005000
261
-extra_scripts        = ${stm32f1_variant.extra_scripts}
238
+build_flags                 = ${stm32_variant.build_flags} -DSS_TIMER=4
262 239
 
263 240
 #
264 241
 # MKS Robin Mini (STM32F103VET6)
265 242
 #
266 243
 [env:mks_robin_mini]
267
-platform            = ${common_stm32.platform}
268
-extends             = common_stm32
269
-board               = genericSTM32F103VE
270
-board_build.core    = stm32
271
-board_build.variant = MARLIN_F103Vx
272
-board_build.offset  = 0x7000
273
-board_build.encrypt = Robin_mini.bin
274
-build_flags         = ${common_stm32.build_flags} -DMCU_STM32F103VE -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2
244
+platform                    = ${common_stm32.platform}
245
+extends                     = stm32_variant
246
+board                       = genericSTM32F103VE
247
+board_build.variant         = MARLIN_F103Vx
248
+board_build.encrypt         = Robin_mini.bin
249
+board_build.offset          = 0x7000
275 250
 board_upload.offset_address = 0x08007000
276
-extra_scripts       = ${stm32f1_variant.extra_scripts}
251
+build_flags                 = ${stm32_variant.build_flags}
252
+                              -DMCU_STM32F103VE -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2
277 253
 
278 254
 #
279 255
 # MKS Robin Lite/Lite2 (STM32F103RCT6)
280 256
 #
281 257
 [env:mks_robin_lite]
282
-platform            = ${common_stm32.platform}
283
-extends             = common_stm32
284
-board               = genericSTM32F103RC
285
-board_build.core    = stm32
286
-board_build.variant = MARLIN_F103Rx
287
-board_build.offset  = 0x5000
288
-board_build.encrypt = mksLite.bin
289
-build_flags         = ${common_stm32.build_flags}
258
+platform                    = ${common_stm32.platform}
259
+extends                     = stm32_variant
260
+board                       = genericSTM32F103RC
261
+board_build.variant         = MARLIN_F103Rx
262
+board_build.encrypt         = mksLite.bin
263
+board_build.offset          = 0x5000
290 264
 board_upload.offset_address = 0x08005000
291
-extra_scripts       = ${stm32f1_variant.extra_scripts}
292 265
 
293 266
 #
294 267
 # MKS ROBIN LITE3 (STM32F103RCT6)
295 268
 #
296 269
 [env:mks_robin_lite3]
297
-platform            = ${common_stm32.platform}
298
-extends             = common_stm32
299
-board               = genericSTM32F103RC
300
-board_build.core    = stm32
301
-board_build.variant = MARLIN_F103Rx
302
-board_build.offset  = 0x5000
303
-board_build.encrypt = mksLite3.bin
304
-build_flags         = ${common_stm32.build_flags}
305
-board_upload.offset_address = 0x08005000
306
-extra_scripts       = ${stm32f1_variant.extra_scripts}
270
+platform                    = ${common_stm32.platform}
271
+extends                     = env:mks_robin_lite
272
+board_build.encrypt         = mksLite3.bin
307 273
 
308 274
 #
309 275
 # MKS Robin Pro (STM32F103ZET6)
@@ -318,44 +284,43 @@ board_build.encrypt = Robin_pro.bin
318 284
 #  - LVGL UI
319 285
 #
320 286
 [env:mks_robin_e3p]
321
-platform            = ${common_stm32.platform}
322
-extends             = common_stm32
323
-board               = genericSTM32F103VE
324
-board_build.core    = stm32
325
-board_build.variant = MARLIN_F103Vx
326
-board_build.offset  = 0x7000
327
-board_build.encrypt = Robin_e3p.bin
328
-build_flags         = ${common_stm32.build_flags} -DMCU_STM32F103VE -DSS_TIMER=4 -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2
287
+platform                    = ${common_stm32.platform}
288
+extends                     = stm32_variant
289
+board                       = genericSTM32F103VE
290
+board_build.variant         = MARLIN_F103Vx
291
+board_build.encrypt         = Robin_e3p.bin
292
+board_build.offset          = 0x7000
329 293
 board_upload.offset_address = 0x08007000
330
-extra_scripts       = ${stm32f1_variant.extra_scripts}
331
-debug_tool          = jlink
332
-upload_protocol     = jlink
294
+build_flags                 = ${stm32_variant.build_flags}
295
+                              -DMCU_STM32F103VE -DSS_TIMER=4
296
+                              -DTIMER_TONE=TIM3 -DTIMER_SERVO=TIM2
297
+debug_tool                  = jlink
298
+upload_protocol             = jlink
333 299
 
334 300
 #
335 301
 # JGAurora A5S A1 (STM32F103ZET6)
336 302
 #
337 303
 [env:jgaurora_a5s_a1]
338
-platform            = ${common_stm32.platform}
339
-extends             = common_stm32
340
-board               = genericSTM32F103ZE
341
-board_build.core    = stm32
342
-board_build.variant = MARLIN_F103Zx
343
-board_build.offset  = 0xA000
344
-board_build.rename  = firmware_for_sd_upload.bin
345
-build_flags         = ${common_stm32.build_flags} -DSTM32F1xx -DSTM32_XL_DENSITY
346
-board_build.address = 0x0800A000
347
-extra_scripts       = ${stm32f1_variant.extra_scripts}
348
-  buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py
304
+platform                    = ${common_stm32.platform}
305
+extends                     = stm32_variant
306
+board                       = genericSTM32F103ZE
307
+board_build.variant         = MARLIN_F103Zx
308
+board_build.offset          = 0xA000
309
+board_build.rename          = firmware_for_sd_upload.bin
310
+board_upload.offset_address = 0x0800A000
311
+build_flags                 = ${stm32_variant.build_flags}
312
+                              -DSTM32F1xx -DSTM32_XL_DENSITY
313
+extra_scripts               = ${stm32_variant.extra_scripts}
314
+                              buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py
349 315
 
350 316
 #
351 317
 # FYSETC STM32F103RC
352 318
 #
353 319
 [env:STM32F103RC_fysetc]
354 320
 platform        = ${common_stm32.platform}
355
-extends         = common_STM32F103RC
356
-extra_scripts   = ${stm32f1_variant.extra_scripts}
357
-  buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py
358
-build_flags     = ${common_stm32.build_flags} -DDEBUG_LEVEL=0
321
+extends         = common_STM32F103RC_variant
322
+extra_scripts   = ${common_STM32F103RC_variant.extra_scripts}
323
+                  buildroot/share/PlatformIO/scripts/STM32F103RC_fysetc.py
359 324
 lib_ldf_mode    = chain
360 325
 debug_tool      = stlink
361 326
 upload_protocol = serial
@@ -364,20 +329,20 @@ upload_protocol = serial
364 329
 # Longer 3D board in Alfawise U20 (STM32F103VET6)
365 330
 #
366 331
 [env:STM32F103VE_longer]
367
-platform            = ${common_stm32.platform}
368
-extends             = common_stm32
369
-board               = genericSTM32F103VE
370
-board_build.core    = stm32
371
-board_build.variant = MARLIN_F103Vx
372
-board_build.offset  = 0x10000
373
-board_build.address = 0x08010000
374
-build_flags         = ${common_stm32.build_flags} -DMCU_STM32F103VE -DU20 -DTS_V12
375
-  -DLED_BUILTIN=PC2 -UPIN_WIRE_SDA -UPIN_WIRE_SCL -DPIN_WIRE_SDA=PB11 -DPIN_WIRE_SCL=PB10
376
-  -DHAL_DAC_MODULE_DISABLED -DHAL_I2S_MODULE_DISABLED
377
-build_unflags       = ${common_stm32.build_unflags}
378
-  -DUSBCON -DUSBD_USE_CDC -DHAL_PCD_MODULE_ENABLED
379
-extra_scripts       = ${stm32f1_variant.extra_scripts}
380
-  buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py
332
+platform                    = ${common_stm32.platform}
333
+extends                     = stm32_variant
334
+board                       = genericSTM32F103VE
335
+board_build.variant         = MARLIN_F103Vx
336
+board_build.offset          = 0x10000
337
+board_upload.offset_address = 0x08010000
338
+build_flags                 = ${stm32_variant.build_flags}
339
+                              -DMCU_STM32F103VE -DU20 -DTS_V12 -DLED_BUILTIN=PC2 -UPIN_WIRE_SDA 
340
+                              -UPIN_WIRE_SCL -DPIN_WIRE_SDA=PB11 -DPIN_WIRE_SCL=PB10
341
+                              -DHAL_DAC_MODULE_DISABLED -DHAL_I2S_MODULE_DISABLED
342
+build_unflags               = ${stm32_variant.build_unflags}
343
+                              -DUSBCON -DUSBD_USE_CDC -DHAL_PCD_MODULE_ENABLED
344
+extra_scripts               = ${stm32_variant.extra_scripts}
345
+                              buildroot/share/PlatformIO/scripts/STM32F103VE_longer.py
381 346
 
382 347
 #
383 348
 # TRIGORILLA PRO (STM32F103ZET6)
@@ -392,15 +357,16 @@ extra_scripts = ${common_stm32.extra_scripts}
392 357
 #
393 358
 [env:chitu_f103]
394 359
 platform             = ${common_stm32.platform}
395
-extends              = common_stm32
360
+extends              = stm32_variant
396 361
 board                = genericSTM32F103ZE
397
-board_build.core     = stm32
398 362
 board_build.variant  = MARLIN_F103Zx
399
-extra_scripts        = ${stm32f1_variant.extra_scripts}
400
-  buildroot/share/PlatformIO/scripts/chitu_crypt.py
401
-build_flags          = ${common_stm32.build_flags} -DSTM32_XL_DENSITY
402
-build_unflags        = ${common_stm32.build_unflags}
403
-  -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG= -DERROR_LED_PORT=GPIOE -DERROR_LED_PIN=6
363
+build_flags          = ${stm32_variant.build_flags}
364
+                       -DSTM32F1xx -DSTM32_XL_DENSITY
365
+build_unflags        = ${stm32_variant.build_unflags}
366
+                       -DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=
367
+                       -DERROR_LED_PORT=GPIOE -DERROR_LED_PIN=6
368
+extra_scripts        = ${stm32_variant.extra_scripts}
369
+                       buildroot/share/PlatformIO/scripts/chitu_crypt.py
404 370
 
405 371
 #
406 372
 # Some Chitu V5 boards have a problem with GPIO init.

+ 140
- 178
ini/stm32f4.ini View File

@@ -12,8 +12,8 @@
12 12
 #   F : Foundation (sometimes High Performance F2/F4)
13 13
 #   4 : Cortex M4 core
14 14
 #  01 : Line/Features
15
-#   R : 64 or 66 pins  (V:100, Z:144, I:176)
16
-#   G : 1024KB Flash-memory  (C:256KB, D:384KB, E:512KB)
15
+#   R : 64 or 66 pins  (T:36, C:48 or 49, M:81, V:100, Z:144, I:176)
16
+#   G : 1024KB Flash-memory  (B:128KB, C:256KB, D:384KB, E:512KB)
17 17
 #   T : LQFP package
18 18
 #   6 : -40...85°C   (7: ...105°C)
19 19
 #
@@ -27,12 +27,7 @@ platform      = ${common_stm32.platform}
27 27
 extends       = common_stm32
28 28
 board         = armed_v1
29 29
 build_flags   = ${common_stm32.build_flags}
30
-  -O2 -ffreestanding -fsigned-char -fno-move-loop-invariants -fno-strict-aliasing
31
-
32
-[stm32f4_variant]
33
-extra_scripts        = ${common.extra_scripts}
34
-  pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
35
-  buildroot/share/PlatformIO/scripts/offset_and_rename.py
30
+                -O2 -ffreestanding -fsigned-char -fno-move-loop-invariants -fno-strict-aliasing
36 31
 
37 32
 #
38 33
 # STM32F401VE
@@ -40,49 +35,46 @@ extra_scripts        = ${common.extra_scripts}
40 35
 #
41 36
 [env:STM32F401VE_STEVAL]
42 37
 platform          = ${common_stm32.platform}
43
-extends           = common_stm32
38
+extends           = stm32_variant
44 39
 board             = marlin_STEVAL_STM32F401VE
45
-build_flags       = ${common_stm32.build_flags}
46
-  -DARDUINO_STEVAL -DSTM32F401xE
47
-  -DDISABLE_GENERIC_SERIALUSB -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS
48
-extra_scripts     = ${stm32f4_variant.extra_scripts}
40
+build_flags       = ${stm32_variant.build_flags}
41
+                    -DSTM32F401xE -DDISABLE_GENERIC_SERIALUSB
42
+                    -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS
49 43
 
50 44
 #
51 45
 # STM32F401RC
52 46
 #
53 47
 [env:FYSETC_CHEETAH_V20]
54
-platform          = ${common_stm32.platform}
55
-extends           = common_stm32
56
-board             = marlin_FYSETC_CHEETAH_V20
57
-build_flags       = ${common_stm32.build_flags} -DSTM32F401xC -DVECT_TAB_OFFSET=0xC000
58
-extra_scripts     = ${stm32f4_variant.extra_scripts}
48
+platform           = ${common_stm32.platform}
49
+extends            = stm32_variant
50
+board              = marlin_FYSETC_CHEETAH_V20
51
+board_build.offset = 0xC000
52
+build_flags        = ${stm32_variant.build_flags} -DSTM32F401xC
59 53
 
60 54
 #
61 55
 # FLYF407ZG
62 56
 #
63 57
 [env:FLYF407ZG]
64 58
 platform            = ${common_stm32.platform}
65
-extends             = common_stm32
59
+extends             = stm32_variant
66 60
 board               = marlin_STM32F407ZGT6
67 61
 board_build.variant = MARLIN_FLY_F407ZG
62
+board_build.offset  = 0x8000
68 63
 upload_protocol     = dfu
69
-build_flags         = ${common_stm32.build_flags}
70
-  -DVECT_TAB_OFFSET=0x8000
71
-extra_scripts       = ${stm32f4_variant.extra_scripts}
72 64
 
73 65
 #
74 66
 # FYSETC S6 (STM32F446RET6 ARM Cortex-M4)
75 67
 #
76 68
 [env:FYSETC_S6]
77
-platform          = ${common_stm32.platform}
78
-extends           = common_stm32
79
-platform_packages = tool-stm32duino
80
-board             = marlin_fysetc_s6
81
-build_flags       = ${common_stm32.build_flags} -DVECT_TAB_OFFSET=0x10000 -DHAL_PCD_MODULE_ENABLED
82
-extra_scripts     = ${stm32f4_variant.extra_scripts}
83
-debug_tool        = stlink
84
-upload_protocol   = dfu
85
-upload_command    = dfu-util -a 0 -s 0x08010000:leave -D "$SOURCE"
69
+platform                    = ${common_stm32.platform}
70
+extends                     = stm32_variant
71
+board                       = marlin_fysetc_s6
72
+board_build.offset          = 0x10000
73
+board_upload.offset_address = 0x08010000
74
+build_flags                 = ${stm32_variant.build_flags} -DHAL_PCD_MODULE_ENABLED
75
+debug_tool                  = stlink
76
+upload_protocol             = dfu
77
+upload_command              = dfu-util -a 0 -s 0x08010000:leave -D "$SOURCE"
86 78
 
87 79
 #
88 80
 # FYSETC S6 new bootloader
@@ -93,8 +85,6 @@ extends                     = env:FYSETC_S6
93 85
 board                       = marlin_fysetc_s6_8000
94 86
 board_build.offset          = 0x8000
95 87
 board_upload.offset_address = 0x08008000
96
-build_flags                 = ${common_stm32.build_flags} -DHAL_PCD_MODULE_ENABLED
97
-extra_scripts               = ${stm32f4_variant.extra_scripts}
98 88
 upload_command              = dfu-util -a 0 -s 0x08008000:leave -D "$SOURCE"
99 89
 
100 90
 #
@@ -104,12 +94,10 @@ upload_command              = dfu-util -a 0 -s 0x08008000:leave -D "$SOURCE"
104 94
 #
105 95
 [env:STM32F407VE_black]
106 96
 platform          = ${common_stm32.platform}
107
-extends           = common_stm32
97
+extends           = stm32_variant
108 98
 board             = marlin_blackSTM32F407VET6
109
-build_flags       = ${common_stm32.build_flags}
110
-  -DARDUINO_BLACK_F407VE
111
-  -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS
112
-extra_scripts     = ${stm32f4_variant.extra_scripts}
99
+build_flags       = ${stm32_variant.build_flags}
100
+                    -DUSBD_USE_CDC_COMPOSITE -DUSE_USB_FS
113 101
 
114 102
 #
115 103
 # Anet ET4-MB_V1.x/ET4P-MB_V1.x (STM32F407VGT6 ARM Cortex-M4)
@@ -117,120 +105,108 @@ extra_scripts     = ${stm32f4_variant.extra_scripts}
117 105
 # Comment out board_build.offset = 0x10000 if you don't plan to use OpenBLT/flashing directly to 0x08000000.
118 106
 #
119 107
 [env:Anet_ET4_OpenBLT]
120
-platform             = ${common_stm32.platform}
121
-extends              = common_stm32
122
-build_flags          = ${common_stm32.build_flags} -DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED
123
-board                = marlin_STM32F407VGT6_CCM
124
-board_build.core     = stm32
125
-board_build.variant  = MARLIN_F4x7Vx
126
-board_build.encrypt  = firmware.srec
127
-board_build.offset   = 0x10000
108
+platform                    = ${common_stm32.platform}
109
+extends                     = stm32_variant
110
+board                       = marlin_STM32F407VGT6_CCM
111
+board_build.variant         = MARLIN_F4x7Vx
112
+board_build.encrypt         = firmware.srec
113
+board_build.offset          = 0x10000
128 114
 board_upload.offset_address = 0x08010000
129
-build_unflags        = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483
130
-debug_tool           = jlink
131
-upload_protocol      = jlink
132
-extra_scripts        = ${stm32f4_variant.extra_scripts}
133
-  buildroot/share/PlatformIO/scripts/openblt.py
115
+build_flags                 = ${stm32_variant.build_flags}
116
+                              -DHAL_SD_MODULE_ENABLED -DHAL_SRAM_MODULE_ENABLED
117
+build_unflags               = ${stm32_variant.build_unflags}
118
+                              -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483
119
+extra_scripts               = ${stm32_variant.extra_scripts}
120
+                              buildroot/share/PlatformIO/scripts/openblt.py
121
+debug_tool                  = jlink
122
+upload_protocol             = jlink
134 123
 
135 124
 #
136 125
 # BigTreeTech SKR Pro (STM32F407ZGT6 ARM Cortex-M4)
137 126
 #
138 127
 [env:BIGTREE_SKR_PRO]
139
-platform          = ${common_stm32.platform}
140
-extends           = common_stm32
141
-board             = marlin_BigTree_SKR_Pro
142
-build_flags       = ${common_stm32.build_flags}
143
-  -DSTM32F407_5ZX -DVECT_TAB_OFFSET=0x8000
144
-extra_scripts     = ${stm32f4_variant.extra_scripts}
145
-#upload_protocol   = stlink
146
-#upload_command    = "$PROJECT_PACKAGES_DIR/tool-stm32duino/stlink/ST-LINK_CLI.exe" -c SWD -P "$BUILD_DIR/firmware.bin" 0x8008000 -Rst -Run
147
-debug_tool        = stlink
148
-debug_init_break  =
149
-
150
-#
151
-# USB Flash Drive mix-ins for STM32
152
-#
153
-[stm_flash_drive]
154
-platform_packages = framework-arduinoststm32@https://github.com/rhapsodyv/Arduino_Core_STM32/archive/usb-host-msc-cdc-msc-3.zip
155
-build_flags       = ${common_stm32.build_flags}
156
-  -DHAL_PCD_MODULE_ENABLED -DHAL_HCD_MODULE_ENABLED
157
-  -DUSBHOST -DUSBH_IRQ_PRIO=3 -DUSBH_IRQ_SUBPRIO=4
128
+platform           = ${common_stm32.platform}
129
+extends            = stm32_variant
130
+board              = marlin_BigTree_SKR_Pro
131
+board_build.offset = 0x8000
132
+build_flags        = ${stm32_variant.build_flags} -DSTM32F407_5ZX 
133
+debug_tool         = stlink
134
+upload_protocol    = stlink
158 135
 
159 136
 #
160 137
 # BigTreeTech SKR Pro (STM32F407ZGT6 ARM Cortex-M4) with USB Flash Drive Support
161 138
 #
162 139
 [env:BIGTREE_SKR_PRO_usb_flash_drive]
140
+platform          = ${common_stm32.platform}
163 141
 extends           = env:BIGTREE_SKR_PRO
164 142
 platform_packages = ${stm_flash_drive.platform_packages}
165
-build_unflags     = -DUSBCON -DUSBD_USE_CDC
166
-build_flags       = ${stm_flash_drive.build_flags}
167
-  -DSTM32F407_5ZX -DVECT_TAB_OFFSET=0x8000
143
+build_flags       = ${stm_flash_drive.build_flags} -DSTM32F407_5ZX
144
+build_unflags     = ${env:BIGTREE_SKR_PRO.build_unflags} -DUSBCON -DUSBD_USE_CDC
168 145
 
169 146
 #
170 147
 # BigTreeTech E3 RRF (STM32F407VGT6 ARM Cortex-M4)
171 148
 #
172 149
 [env:BIGTREE_E3_RRF]
173 150
 platform            = ${common_stm32.platform}
174
-extends             = common_stm32
151
+extends             = stm32_variant
175 152
 board               = marlin_STM32F407VGT6_CCM
176 153
 board_build.variant = MARLIN_BIGTREE_E3_RRF
177
-build_flags         = ${common_stm32.build_flags}
178
-  -DSTM32F407_5VX -DVECT_TAB_OFFSET=0x8000
179
-  -DSERIAL_RX_BUFFER_SIZE=255 -DSERIAL_TX_BUFFER_SIZE=255
180
-extra_scripts       = ${stm32f4_variant.extra_scripts}
154
+board_build.offset  = 0x8000
155
+build_flags         = ${stm32_variant.build_flags}
156
+                      -DSTM32F407_5VX
157
+                      -DSERIAL_RX_BUFFER_SIZE=255
158
+                      -DSERIAL_TX_BUFFER_SIZE=255
181 159
 
182 160
 #
183 161
 # Bigtreetech GTR V1.0 (STM32F407IGT6 ARM Cortex-M4)
184 162
 #
185 163
 [env:BIGTREE_GTR_V1_0]
186
-platform          = ${common_stm32.platform}
187
-extends           = common_stm32
188
-board             = marlin_BigTree_GTR_v1
189
-extra_scripts     = ${stm32f4_variant.extra_scripts}
190
-build_flags       = ${common_stm32.build_flags}
191
-  -DSTM32F407IX -DVECT_TAB_OFFSET=0x8000
164
+platform           = ${common_stm32.platform}
165
+extends            = stm32_variant
166
+board              = marlin_BigTree_GTR_v1
167
+board_build.offset = 0x8000
168
+build_flags        = ${stm32_variant.build_flags} -DSTM32F407IX
192 169
 
193 170
 #
194 171
 # Bigtreetech GTR V1.0 (STM32F407IGT6 ARM Cortex-M4) with USB Flash Drive Support
195 172
 #
196 173
 [env:BIGTREE_GTR_V1_0_usb_flash_drive]
174
+platform          = ${common_stm32.platform}
197 175
 extends           = env:BIGTREE_GTR_V1_0
198 176
 platform_packages = ${stm_flash_drive.platform_packages}
199
-build_unflags     = -DUSBCON -DUSBD_USE_CDC
200
-build_flags       = ${stm_flash_drive.build_flags}
201
-  -DSTM32F407IX -DVECT_TAB_OFFSET=0x8000
177
+build_flags       = ${stm_flash_drive.build_flags} -DSTM32F407IX
178
+build_unflags     = ${env:BIGTREE_GTR_V1_0.build_unflags} -DUSBCON -DUSBD_USE_CDC
202 179
 
203 180
 #
204 181
 # BigTreeTech BTT002 V1.0 (STM32F407VGT6 ARM Cortex-M4)
205 182
 #
206 183
 [env:BIGTREE_BTT002]
207
-platform          = ${common_stm32.platform}
208
-extends           = common_stm32
209
-board             = marlin_BigTree_BTT002
210
-build_flags       = ${common_stm32.build_flags}
211
-  -DSTM32F407_5VX -DVECT_TAB_OFFSET=0x8000
212
-  -DHAVE_HWSERIAL2
213
-  -DHAVE_HWSERIAL3
214
-  -DPIN_SERIAL2_RX=PD_6
215
-  -DPIN_SERIAL2_TX=PD_5
216
-extra_scripts     = ${stm32f4_variant.extra_scripts}
184
+platform           = ${common_stm32.platform}
185
+extends            = stm32_variant
186
+board              = marlin_BigTree_BTT002
187
+board_build.offset = 0x8000
188
+build_flags        = ${stm32_variant.build_flags}
189
+                     -DSTM32F407_5VX
190
+                     -DHAVE_HWSERIAL2
191
+                     -DHAVE_HWSERIAL3
192
+                     -DPIN_SERIAL2_RX=PD_6
193
+                     -DPIN_SERIAL2_TX=PD_5
217 194
 
218 195
 #
219 196
 # BigTreeTech SKR V2.0 (STM32F407VGT6 ARM Cortex-M4) with USB Flash Drive Support
220 197
 #
221 198
 [env:BIGTREE_SKR_2]
222
-platform             = ${common_stm32.platform}
223
-platform_packages    = ${stm_flash_drive.platform_packages}
224
-extends              = common_stm32
225
-board                = marlin_STM32F407VGT6_CCM
226
-board_build.core     = stm32
227
-board_build.variant  = MARLIN_F4x7Vx
228
-board_build.offset   = 0x8000
199
+platform                    = ${common_stm32.platform}
200
+extends                     = stm32_variant
201
+platform_packages           = ${stm_flash_drive.platform_packages}
202
+board                       = marlin_STM32F407VGT6_CCM
203
+board_build.variant         = MARLIN_F4x7Vx
204
+board_build.offset          = 0x8000
229 205
 board_upload.offset_address = 0x08008000
230
-extra_scripts        = ${stm32f4_variant.extra_scripts}
231
-build_flags          = ${stm_flash_drive.build_flags}
232
-  -DUSE_USBHOST_HS -DUSE_USB_HS_IN_FS -DUSBD_IRQ_PRIO=5 -DUSBD_IRQ_SUBPRIO=6
233
-  -DHSE_VALUE=8000000U -DHAL_SD_MODULE_ENABLED
206
+build_flags                 = ${stm_flash_drive.build_flags}
207
+                              -DUSE_USBHOST_HS -DUSE_USB_HS_IN_FS
208
+                              -DUSBD_IRQ_PRIO=5 -DUSBD_IRQ_SUBPRIO=6
209
+                              -DHSE_VALUE=8000000U -DHAL_SD_MODULE_ENABLED
234 210
 
235 211
 #
236 212
 # BigTreeTech SKR V2.0 (STM32F407VGT6 ARM Cortex-M4) with USB Media Share Support
@@ -238,49 +214,50 @@ build_flags          = ${stm_flash_drive.build_flags}
238 214
 [env:BIGTREE_SKR_2_USB]
239 215
 platform          = ${common_stm32.platform}
240 216
 extends           = env:BIGTREE_SKR_2
241
-platform_packages = ${stm_flash_drive.platform_packages}
242
-build_unflags     = -DUSBD_USE_CDC
243 217
 build_flags       = ${env:BIGTREE_SKR_2.build_flags} -DUSBD_USE_CDC_MSC
218
+build_unflags     = ${env:BIGTREE_SKR_2.build_unflags} -DUSBD_USE_CDC
244 219
 
245 220
 #
246 221
 # BigTreeTech Octopus V1.0/1.1 (STM32F446ZET6 ARM Cortex-M4)
247 222
 #
248 223
 [env:BIGTREE_OCTOPUS_V1]
249
-platform          = ${common_stm32.platform}
250
-extends           = common_stm32
251
-board             = marlin_BigTree_Octopus_v1
252
-extra_scripts     = ${stm32f4_variant.extra_scripts}
253
-build_flags       = ${common_stm32.build_flags}
254
-  -DSTM32F446_5VX -DVECT_TAB_OFFSET=0x8000 -DUSE_USB_HS_IN_FS
224
+platform           = ${common_stm32.platform}
225
+extends            = stm32_variant
226
+board              = marlin_BigTree_Octopus_v1
227
+board_build.offset = 0x8000
228
+build_flags        = ${stm32_variant.build_flags}
229
+                     -DSTM32F446_5VX -DUSE_USB_HS_IN_FS
255 230
 
256 231
 #
257 232
 # BigTreeTech Octopus V1.0/1.1 (STM32F446ZET6 ARM Cortex-M4) with USB Flash Drive Support
258 233
 #
259 234
 [env:BIGTREE_OCTOPUS_V1_USB]
235
+platform          = ${common_stm32.platform}
260 236
 extends           = env:BIGTREE_OCTOPUS_V1
261 237
 platform_packages = ${stm_flash_drive.platform_packages}
262
-#build_unflags     = -DUSBCON -DUSBD_USE_CDC
263 238
 build_flags       = ${stm_flash_drive.build_flags}
264
-  -DSTM32F446_5VX -DVECT_TAB_OFFSET=0x8000
265
-  -DUSBCON -DUSE_USBHOST_HS -DUSBD_IRQ_PRIO=5 -DUSBD_IRQ_SUBPRIO=6 -DUSE_USB_HS_IN_FS -DUSBD_USE_CDC_MSC
239
+                    -DSTM32F446_5VX -DUSE_USB_HS_IN_FS
240
+                    -DUSE_USBHOST_HS -DUSBD_IRQ_PRIO=5
241
+                    -DUSBD_IRQ_SUBPRIO=6
242
+                    -DUSBD_USE_CDC_MSC
266 243
 
267 244
 #
268 245
 # Lerdge base
269 246
 #
270 247
 [lerdge_common]
271 248
 platform            = ${common_stm32.platform}
272
-extends             = common_stm32
249
+extends             = stm32_variant
273 250
 board               = marlin_STM32F407ZGT6
274 251
 board_build.variant = MARLIN_LERDGE
275
-board_build.offset  = 0x10000
276 252
 board_build.encrypt = firmware.bin
277
-extra_scripts       = ${stm32f4_variant.extra_scripts}
253
+board_build.offset  = 0x10000
254
+build_flags         = ${stm32_variant.build_flags}
255
+                      -DSTM32F4 -DSTM32F4xx -DTARGET_STM32F4
256
+                      -DDISABLE_GENERIC_SERIALUSB -DARDUINO_ARCH_STM32 -DARDUINO_LERDGE
257
+                      -DHAL_SRAM_MODULE_ENABLED
258
+build_unflags       = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483
259
+extra_scripts       = ${stm32_variant.extra_scripts}
278 260
                       buildroot/share/PlatformIO/scripts/lerdge.py
279
-build_flags         = ${common_stm32.build_flags}
280
-  -DSTM32F4 -DSTM32F4xx -DTARGET_STM32F4
281
-  -DDISABLE_GENERIC_SERIALUSB -DARDUINO_ARCH_STM32 -DARDUINO_LERDGE
282
-  -DHAL_SRAM_MODULE_ENABLED
283
-build_unflags       = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483
284 261
 
285 262
 #
286 263
 # Lerdge X
@@ -339,38 +316,33 @@ build_flags       = ${stm_flash_drive.build_flags} ${lerdge_common.build_flags}
339 316
 #
340 317
 [env:rumba32]
341 318
 platform             = ${common_stm32.platform}
342
-extends              = common_stm32
343
-build_flags          = ${common_stm32.build_flags}
344
-  -Os
345
-  -DHAL_PCD_MODULE_ENABLED
346
-  -DDISABLE_GENERIC_SERIALUSB
347
-  -DHAL_UART_MODULE_ENABLED
348
-  -DTIMER_SERIAL=TIM9
319
+extends              = stm32_variant
349 320
 board                = rumba32_f446ve
350
-upload_protocol      = dfu
351
-monitor_speed        = 500000
352
-board_build.core     = stm32
353 321
 board_build.variant  = MARLIN_F446VE
354 322
 board_build.offset   = 0x0000
355
-extra_scripts        = ${stm32f4_variant.extra_scripts}
323
+build_flags          = ${stm32_variant.build_flags}
324
+                       -Os -DHAL_PCD_MODULE_ENABLED
325
+                       -DDISABLE_GENERIC_SERIALUSB
326
+                       -DHAL_UART_MODULE_ENABLED
327
+                       -DTIMER_SERIAL=TIM9
328
+monitor_speed        = 500000
329
+upload_protocol      = dfu
356 330
 
357 331
 #
358 332
 # MKS Robin Pro V2
359 333
 #
360 334
 [env:mks_robin_pro2]
361
-platform             = ${common_stm32.platform}
362
-platform_packages    = ${stm_flash_drive.platform_packages}
363
-extends              = common_stm32
364
-build_flags          = ${stm_flash_drive.build_flags}
365
-board                = genericSTM32F407VET6
366
-board_build.core     = stm32
367
-board_build.variant  = MARLIN_F4x7Vx
368
-board_build.offset   = 0x0000
335
+platform                    = ${common_stm32.platform}
336
+extends                     = stm32_variant
337
+platform_packages           = ${stm_flash_drive.platform_packages}
338
+board                       = genericSTM32F407VET6
339
+board_build.variant         = MARLIN_F4x7Vx
340
+board_build.offset          = 0x0000
369 341
 board_upload.offset_address = 0x08000000
370
-build_unflags        = ${common_stm32.build_unflags} -DUSBCON -DUSBD_USE_CDC
371
-debug_tool           = jlink
372
-upload_protocol      = jlink
373
-extra_scripts        = ${stm32f4_variant.extra_scripts}
342
+build_flags                 = ${stm_flash_drive.build_flags}
343
+build_unflags               = ${stm32_variant.build_unflags} -DUSBCON -DUSBD_USE_CDC
344
+debug_tool                  = jlink
345
+upload_protocol             = jlink
374 346
 
375 347
 #
376 348
 # This SPI is used by Robin Nano V3
@@ -382,34 +354,31 @@ build_flags = -DPIN_WIRE_SCL=PB6 -DPIN_WIRE_SDA=PB7
382 354
 # MKS Robin Nano V3
383 355
 #
384 356
 [env:mks_robin_nano_v3]
385
-platform             = ${common_stm32.platform}
386
-extends              = common_stm32
387
-build_flags          = ${common_stm32.build_flags} ${stm32f4_I2C1.build_flags} -DHAL_PCD_MODULE_ENABLED -DUSBCON -DUSBD_USE_CDC
388
-board                = marlin_STM32F407VGT6_CCM
389
-board_build.core     = stm32
390
-board_build.variant  = MARLIN_F4x7Vx
391
-board_build.rename   = Robin_nano_v3.bin
392
-board_build.offset   = 0xC000
357
+platform                    = ${common_stm32.platform}
358
+extends                     = stm32_variant
359
+board                       = marlin_STM32F407VGT6_CCM
360
+board_build.variant         = MARLIN_F4x7Vx
361
+board_build.offset          = 0xC000
362
+board_build.rename          = Robin_nano_v3.bin
393 363
 board_upload.offset_address = 0x0800C000
394
-build_unflags        = ${common_stm32.build_unflags}
395
-debug_tool           = jlink
396
-upload_protocol      = jlink
397
-extra_scripts        = ${stm32f4_variant.extra_scripts}
364
+build_flags                 = ${stm32_variant.build_flags} ${stm32f4_I2C1.build_flags}
365
+                              -DHAL_PCD_MODULE_ENABLED
366
+debug_tool                  = jlink
367
+upload_protocol             = jlink
398 368
 
399 369
 #
400 370
 # MKS Robin Nano V3 with USB Flash Drive Support
401 371
 # Currently, using a STM32duino fork, until USB Host get merged
402 372
 #
403 373
 [env:mks_robin_nano_v3_usb_flash_drive]
374
+platform          = ${common_stm32.platform}
404 375
 extends           = env:mks_robin_nano_v3
405 376
 platform_packages = ${stm_flash_drive.platform_packages}
406 377
 build_flags       = ${stm_flash_drive.build_flags} ${stm32f4_I2C1.build_flags}
407
-  -DUSBCON
408
-  -DUSE_USBHOST_HS
409
-  -DUSBD_IRQ_PRIO=5
410
-  -DUSBD_IRQ_SUBPRIO=6
411
-  -DUSE_USB_HS_IN_FS
412
-  -DUSBD_USE_CDC
378
+                    -DUSE_USBHOST_HS
379
+                    -DUSBD_IRQ_PRIO=5
380
+                    -DUSBD_IRQ_SUBPRIO=6
381
+                    -DUSE_USB_HS_IN_FS
413 382
 
414 383
 #
415 384
 # MKS Robin Nano V3 with USB Flash Drive Support and Shared Media
@@ -417,13 +386,6 @@ build_flags       = ${stm_flash_drive.build_flags} ${stm32f4_I2C1.build_flags}
417 386
 #
418 387
 [env:mks_robin_nano_v3_usb_flash_drive_msc]
419 388
 platform          = ${common_stm32.platform}
420
-extends           = env:mks_robin_nano_v3
421
-platform_packages = framework-arduinoststm32@https://github.com/rhapsodyv/Arduino_Core_STM32/archive/usb-host-msc-cdc-msc-3.zip
422
-build_unflags     = ${common_stm32.build_unflags} -DUSBD_USE_CDC
423
-build_flags       = ${stm_flash_drive.build_flags} ${stm32f4_I2C1.build_flags}
424
-  -DUSBCON
425
-  -DUSE_USBHOST_HS
426
-  -DUSBD_IRQ_PRIO=5
427
-  -DUSBD_IRQ_SUBPRIO=6
428
-  -DUSE_USB_HS_IN_FS
429
-  -DUSBD_USE_CDC_MSC
389
+extends           = env:mks_robin_nano_v3_usb_flash_drive
390
+build_flags       = ${env:mks_robin_nano_v3_usb_flash_drive}
391
+                    -DUSBD_USE_CDC_MSC

+ 0
- 26
ini/stm32f7.ini View File

@@ -37,29 +37,3 @@ build_flags   = ${common_stm32.build_flags} -DTIMER_SERIAL=TIM9
37 37
 platform      = ${common_stm32.platform}
38 38
 extends       = common_stm32
39 39
 board         = remram_v1
40
-build_flags   = ${common_stm32.build_flags}
41
-
42
-#
43
-# BigTreeTech SKR SE BX (STM32H743IIT6 ARM Cortex-M7)
44
-#
45
-[env:BTT_SKR_SE_BX]
46
-platform          = ${common_stm32.platform}
47
-platform_packages = ${stm_flash_drive.platform_packages}
48
-extends           = common_stm32
49
-board             = marlin_BTT_SKR_SE_BX
50
-extra_scripts     = ${common.extra_scripts}
51
-  pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
52
-build_flags       = ${common_stm32.build_flags}
53
-  ${stm_flash_drive.build_flags}
54
-  -DUSE_USBHOST_HS
55
-  -DUSE_USB_HS_IN_FS
56
-  #-DUSBD_USE_CDC_MSC
57
-  -DVECT_TAB_OFFSET=0x20000
58
-  -DHAL_DMA2D_MODULE_ENABLED
59
-  -DHAL_LTDC_MODULE_ENABLED
60
-  -DHAL_SDRAM_MODULE_ENABLED
61
-  -DHAL_QSPI_MODULE_ENABLED
62
-  -DHAL_MDMA_MODULE_ENABLED
63
-  -DHAL_SD_MODULE_ENABLED
64
-upload_protocol   = cmsis-dap
65
-debug_tool        = cmsis-dap

+ 41
- 0
ini/stm32h7.ini View File

@@ -0,0 +1,41 @@
1
+#
2
+# Marlin Firmware
3
+# PlatformIO Configuration File
4
+#
5
+
6
+#################################
7
+#
8
+# STM32H7 Architecture
9
+#
10
+# Naming Example: STM32H743IIT6
11
+#
12
+#   H : High Performance
13
+#   7 : Cortex M7 core
14
+#  43 : Line/Features
15
+#   I : 176 pins
16
+#   I : 2048KB Flash-memory
17
+#   T : LQFP package
18
+#   6 : -40...85°C   (7: ...105°C)
19
+#
20
+#################################
21
+
22
+#
23
+# BigTreeTech SKR SE BX (STM32H743IIT6 ARM Cortex-M7)
24
+#
25
+[env:BTT_SKR_SE_BX]
26
+platform           = ${common_stm32.platform}
27
+extends            = stm32_variant
28
+platform_packages  = ${stm_flash_drive.platform_packages}
29
+board              = marlin_BTT_SKR_SE_BX
30
+board_build.offset = 0x20000
31
+build_flags        = ${stm32_variant.build_flags} ${stm_flash_drive.build_flags}
32
+                    -DUSE_USBHOST_HS
33
+                    -DUSE_USB_HS_IN_FS
34
+                    -DHAL_DMA2D_MODULE_ENABLED
35
+                    -DHAL_LTDC_MODULE_ENABLED
36
+                    -DHAL_SDRAM_MODULE_ENABLED
37
+                    -DHAL_QSPI_MODULE_ENABLED
38
+                    -DHAL_MDMA_MODULE_ENABLED
39
+                    -DHAL_SD_MODULE_ENABLED
40
+upload_protocol    = cmsis-dap
41
+debug_tool         = cmsis-dap

+ 2
- 0
platformio.ini View File

@@ -23,11 +23,13 @@ extra_configs =
23 23
     ini/lpc176x.ini
24 24
     ini/native.ini
25 25
     ini/samd51.ini
26
+    ini/stm32-common.ini
26 27
     ini/stm32f0.ini
27 28
     ini/stm32f1-maple.ini
28 29
     ini/stm32f1.ini
29 30
     ini/stm32f4.ini
30 31
     ini/stm32f7.ini
32
+    ini/stm32h7.ini
31 33
     ini/teensy.ini
32 34
 
33 35
 #

Loading…
Cancel
Save