-
Notifications
You must be signed in to change notification settings - Fork 88
/
platformio.ini
413 lines (382 loc) · 12.1 KB
/
platformio.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# This is the configuration file for PlatformIO, a cross-platform tool and IDE
# to build and develop software for embedded systems.
#
# To build the firmware with PlatformIO, install PlatformIO Core (CLI, no GUI):
# - https://docs.platformio.org/en/latest//core/installation.html
#
# For documentation on this file, see:
# - https://docs.platformio.org/en/latest/projectconf/index.html
#
# To add support for another STM32F1xx board, add a new [env:name..] section
# with the appropriate `board` and (optionally) `board_build.ldscript`.
# For a list of supported hardware, see:
# - https://docs.platformio.org/en/latest/platforms/ststm32.html
#
# To add support for additional grblHAL plugins or drivers, make the necessary
# changes to the common.build_flags, common.lib_deps and common.lib_extra_dirs
# below.
#
# By default this file sets the preprocessor directive `OVERRIDE_MY_MACHINE`
# to ignore all settings in `Inc/my_machine.h`. Instead, you should edit this
# file and add the necessary directives (e.g. `-D FOOBAR_ENABLE`) to either
# `common.build_flags` or the environment specific `build_flags`.
#
# Typical command line usage:
#
# # Build firmware for all defined environments
# pio run
# # Build only for specific environments with the -e option
# pio run -e BTT_SKR_MINI_E3_V20 -e BTT_SKR_MINI_E3_V20_USB
# # List the freshly built firmware ELF (.elf) and binary (.bin) files:
# ls -l .pio/build/*/firmware.*
# # If the target supports uploading (via `upload_protocol`):
# pio run -e bluepill_f103c8_128k -t upload
# # Clean up build related resources
# pio run -t clean
#
#
# NOTE: PlatformIO support is provided by the community and platformio.ini is
# not maintained or tested by the repo owner.
# Please submit a PR with bug fixes and enhancments.
#
[platformio]
include_dir = Inc
src_dir = Src
[common]
build_flags =
-I .
-I boards
-I FatFs
-I FatFs/STM
-I Drivers/FATFS/Target
-I Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc
-I Middlewares/ST/STM32_USB_Device_Library/Core/Inc
-I USB_DEVICE/App
-I Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc
-I Middlewares/ST/STM32_USB_Device_Library/Core/Inc
-I USB_DEVICE/Target
-D _USE_IOCTL=1
-D _USE_WRITE=1
-D _VOLUMES=1
-Wl,-u,_printf_float
-Wl,-u,_scanf_float
# Ignore all settings in Inc/my_machine.h (and instead use the below build flags)
-D OVERRIDE_MY_MACHINE
# Uncomment to enable debug builds
#-D DEBUG
# Uncomment to enable support for keypad
#-D KEYPAD_ENABLE=1
# Uncomment to enable support for odometer
#-D ODOMETER_ENABLE=1
# Uncomment to enable support for running G-code from the microSD card
# You also need to uncomment FatFS and sdcard in lib_deps (see below)
#-D SDCARD_ENABLE=1
# Set to 1 or 2 (see Inc/my_machine.h)
#-D SPINDLE_HUANYANG=1
lib_deps =
boards
bluetooth
grbl
keypad
laser
motors
trinamic
odometer
fans
spindle
embroidery
Drivers/FATFS/App
Drivers/FATFS/Target
# USB serial support
Middlewares/ST/STM32_USB_Device_Library/Core
Middlewares/ST/STM32_USB_Device_Library/Class
USB_DEVICE/App
USB_DEVICE/Target
# To enable support for SD card, you must grab a copy FatFS:
# curl -O http://elm-chan.org/fsw/ff/arc/ff14b.zip
# unzip ff14b.zip 'source/*'
# mv source/* FatFS
# rm -fr ff14b.zip source FatFS/diskio.c
# Next, apply the changes outlined in FatFS/README.md and then
# uncomment `FatFS` and `sdcard` below.
FatFs
sdcard
# USB serial support
# Core
# Class
# App
# Target
lib_extra_dirs =
.
boards
FatFs
Middlewares/ST/STM32_USB_Device_Library
USB_DEVICE
[eth_networking]
build_flags =
-I lwip/src/include
-I networking/wiznet
lib_deps =
lwip
networking
lib_extra_dirs =
[env]
platform = ststm32
platform_packages = framework-stm32cubef4 @ ~1.26.2
framework = stm32cube
# Do not produce .a files for lib deps (which would prevent them from overriding weak symbols)
lib_archive = no
lib_ldf_mode = off
[env:btt_skr_pro_1_1]
# Untested and might not boot. Please report issues at:
# https://github.com/grblHAL/STM32F4xx/issues
board = genericSTM32F407VGT6
board_build.ldscript = STM32F407VGTX_BL32K_FLASH.ld
build_flags = ${common.build_flags}
# See Inc/my_machine.h for options
-D BOARD_BTT_SKR_PRO_1_1=
# 8MHz crystal
-D HSE_VALUE=8000000
-D HAS_BOOTLOADER
-D USB_SERIAL_CDC=1
lib_deps = ${common.lib_deps}
eeprom
lib_extra_dirs = ${common.lib_extra_dirs}
# Upload is not supported for this board since BOOT0 is tied to GND.
# With the default boot loader, you must deploy new firmware by copying
# .pio/build/<env name>/firmware.bin (produced by `pio run`) to the SD card.
[env:btt_skr_2_tmc2130]
# Untested and might not boot. Please report issues at:
# https://github.com/grblHAL/STM32F4xx/issues
board = genericSTM32F407VGT6
board_build.ldscript = STM32F407VGTX_BL32K_FLASH.ld
build_flags = ${common.build_flags}
-D WEB_BUILD
-D BOARD_BTT_SKR_20
-D USE_HAL_DRIVER
-D STM32F407xx
-D HSE_VALUE=8000000
-D USB_SERIAL_CDC=1
-D PROBE_ENABLE=1
-D TRINAMIC_ENABLE=2130
-D TRINAMIC_UART_ENABLE=0
-D BLUETOOTH_ENABLE=0
-D NETWORKING_ENABLE=0
-D ESTOP_ENABLE=1
-D SPINDLE0_ENABLE=11
-D N_SPINDLE=1
lib_deps = ${common.lib_deps}
eeprom
lib_extra_dirs = ${common.lib_extra_dirs}
# Upload is not supported for this board since BOOT0 is tied to GND.
# With the default boot loader, you must deploy new firmware by copying
# .pio/build/<env name>/firmware.bin (produced by `pio run`) to the SD card.
[env:btt_skr_2_tmc5160]
# Untested and might not boot. Please report issues at:
# https://github.com/grblHAL/STM32F4xx/issues
board = genericSTM32F407VGT6
board_build.ldscript = STM32F407VGTX_BL32K_FLASH.ld
build_flags = ${common.build_flags}
-D WEB_BUILD
-D BOARD_BTT_SKR_20
-D USE_HAL_DRIVER
-D STM32F407xx
-D HSE_VALUE=8000000
-D USB_SERIAL_CDC=1
-D PROBE_ENABLE=1
-D TRINAMIC_ENABLE=5160
-D TRINAMIC_UART_ENABLE=0
-D BLUETOOTH_ENABLE=0
-D NETWORKING_ENABLE=0
-D ESTOP_ENABLE=1
-D SPINDLE0_ENABLE=11
-D N_SPINDLE=1
lib_deps = ${common.lib_deps}
eeprom
lib_extra_dirs = ${common.lib_extra_dirs}
# Upload is not supported for this board since BOOT0 is tied to GND.
# With the default boot loader, you must deploy new firmware by copying
# .pio/build/<env name>/firmware.bin (produced by `pio run`) to the SD card.
[env:btt_skr_2_tmc2209]
# Untested and might not boot. Please report issues at:
# https://github.com/grblHAL/STM32F4xx/issues
board = genericSTM32F407VGT6
board_build.ldscript = STM32F407VGTX_BL32K_FLASH.ld
build_flags = ${common.build_flags}
-D WEB_BUILD
-D BOARD_BTT_SKR_20
-D USE_HAL_DRIVER
-D STM32F407xx
-D HSE_VALUE=8000000
-D USB_SERIAL_CDC=1
-D PROBE_ENABLE=1
-D TRINAMIC_ENABLE=2209
-D TRINAMIC_UART_ENABLE=2
-D BLUETOOTH_ENABLE=0
-D NETWORKING_ENABLE=0
-D ESTOP_ENABLE=1
-D SPINDLE0_ENABLE=11
-D N_SPINDLE=1
lib_deps = ${common.lib_deps}
eeprom
lib_extra_dirs = ${common.lib_extra_dirs}
# Upload is not supported for this board since BOOT0 is tied to GND.
# With the default boot loader, you must deploy new firmware by copying
# .pio/build/<env name>/firmware.bin (produced by `pio run`) to the SD card.
[env:fysetc_s6]
board = fysetc_s6
board_build.ldscript = STM32F446RETX_NO_BL_FLASH.ld
build_flags = ${common.build_flags}
# See Inc/my_machine.h for options
-D BOARD_FYSETC_S6=
# 12MHz crystal
-D HSE_VALUE=12000000
-D USB_SERIAL_CDC=1
lib_deps = ${common.lib_deps}
eeprom
lib_extra_dirs = ${common.lib_extra_dirs}
upload_protocol = dfu
[env:fysetc_s6_tmc2209]
board = fysetc_s6
board_build.ldscript = STM32F446RETX_NO_BL_FLASH.ld
build_flags = ${common.build_flags}
# See Inc/my_machine.h for options
-D BOARD_FYSETC_S6=
# 12MHz crystal
-D HSE_VALUE=12000000
-D USB_SERIAL_CDC=1
# TMC2209 stepper drivers
-D TRINAMIC_ENABLE=2209
lib_deps = ${common.lib_deps}
eeprom
trinamic
lib_extra_dirs = ${common.lib_extra_dirs}
upload_protocol = dfu
[env:nucleo_f411re_morpho_cnc]
board = nucleo_f411re
board_build.ldscript = STM32F411CEUX_FLASH.ld
build_flags = ${common.build_flags}
# See Inc/my_machine.h for options
-D BOARD_MORPHO_CNC=
-D NUCLEO_F411=
lib_deps = ${common.lib_deps}
eeprom
lib_extra_dirs = ${common.lib_extra_dirs}
# Alternatively, place the .pio/build/<env name>/firmware.bin on the NODE_F4xxRE drive
upload_protocol = stlink
[env:nucleo_f411re_protoneer]
board = nucleo_f411re
board_build.ldscript = STM32F411CEUX_FLASH.ld
build_flags = ${common.build_flags}
# See Inc/my_machine.h for options
-D BOARD_PROTONEER_3XX=
-D NUCLEO_F411=
# Uncomment to enable Spindle PWM output on the SpinDir pin
#-D PROTONEER_SPINDLE_PWM=
lib_deps = ${common.lib_deps}
eeprom
lib_extra_dirs = ${common.lib_extra_dirs}
# Alternatively, place the .pio/build/<env name>/firmware.bin on the NODE_F4xxRE drive
upload_protocol = stlink
[env:nucleo_f446re_morpho_cnc]
board = nucleo_f446re
board_build.ldscript = STM32F446RETX_FLASH.ld
build_flags = ${common.build_flags}
# See Inc/my_machine.h for options
-D BOARD_MORPHO_CNC=
-D NUCLEO_F446=
lib_deps = ${common.lib_deps}
eeprom
lib_extra_dirs = ${common.lib_extra_dirs}
# Alternatively, place the .pio/build/<env name>/firmware.bin on the NODE_F4xxRE drive
upload_protocol = stlink
[env:nucleo_f446re_generic_uno]
board = nucleo_f446re
board_build.ldscript = STM32F446RETX_FLASH.ld
build_flags = ${common.build_flags}
# See Inc/my_machine.h for options
-D BOARD_GENERIC_UNO=
-D NUCLEO_F446=
lib_deps = ${common.lib_deps}
eeprom
lib_extra_dirs = ${common.lib_extra_dirs}
# Alternatively, place the .pio/build/<env name>/firmware.bin on the NODE_F4xxRE drive
upload_protocol = stlink
[env:nucleo_f446re_protoneer]
board = nucleo_f446re
board_build.ldscript = STM32F446RETX_FLASH.ld
build_flags = ${common.build_flags}
# See Inc/my_machine.h for options
-D BOARD_PROTONEER_3XX=
-D NUCLEO_F446=
# Uncomment to enable Spindle PWM output on the SpinDir pin
#-D PROTONEER_SPINDLE_PWM=
lib_deps = ${common.lib_deps}
eeprom
lib_extra_dirs = ${common.lib_extra_dirs}
# Alternatively, place the .pio/build/<env name>/firmware.bin on the NODE_F4xxRE drive
upload_protocol = stlink
[env:blackpill_f411ce]
board = blackpill_f411ce
board_build.ldscript = STM32F411CEUX_FLASH.ld
build_flags = ${common.build_flags}
# See Inc/my_machine.h for options
-D BOARD_BLACKPILL=
-D USB_SERIAL_CDC=1
# Uncomment to enable Spindle PWM output on the SpinDir pin
#-D PROTONEER_SPINDLE_PWM=
lib_deps = ${common.lib_deps}
lib_extra_dirs = ${common.lib_extra_dirs}
# Alternatively, place the .pio/build/<env name>/firmware.bin on the NODE_F4xxRE drive
; change MCU frequency
upload_protocol = dfu
[env:blackpill_f401cc_uni]
board = blackpill_f401cc
board_build.ldscript = STM32F401CCUX_FLASH.ld
build_flags = ${common.build_flags}
# See Inc/my_machine.h for options
-D BOARD_STM32F401_UNI=
-D USB_SERIAL_CDC=1
lib_deps = ${common.lib_deps}
lib_extra_dirs = ${common.lib_extra_dirs}
# Alternatively, place the .pio/build/<env name>/firmware.bin on the NODE_F4xxRE drive
; change MCU frequency
upload_protocol = dfu
[env:Halcyon_v1]
board = genericSTM32F401RC
board_build.ldscript = STM32F401RC_FLASH.ld
build_flags = ${common.build_flags}
# See Inc/my_machine.h for options
-D BOARD_HALCYON_V1=
-D HSE_VALUE=8000000
-D USB_SERIAL_CDC=1
-D SDCARD_ENABLE=1
-D _VOLUMES=1
-D KEYPAD_ENABLE=1
-D EEPROM_IS_FRAM=1
lib_deps = ${common.lib_deps}
eeprom
trinamic
FatFs
sdcard
lib_extra_dirs = ${common.lib_extra_dirs}
[env:Halcyon_v1_dfu]
extends = env:Halcyon_v1
upload_protocol = dfu
[env:Halcyon_v1_stlink]
extends = env:Halcyon_v1
upload_protocol = stlink
[env:f446re_flexi_cnc]
board = genericSTM32F446RE
; change microcontroller
board_build.mcu = stm32f446ret6
board_build.ldscript = STM32F446RETX_BL64K_NONVS_FLASH.ld
build_flags = ${common.build_flags}
-D STM32F446xx=
-D HSE_VALUE=25000000
-D HAS_BOOTLOADER=1
lib_deps = ${common.lib_deps}
eeprom
lib_extra_dirs = ${common.lib_extra_dirs}
# Alternatively, place the .pio/build/<env name>/firmware.bin on the NODE_F4xxRE drive
upload_protocol = stlink