-
Notifications
You must be signed in to change notification settings - Fork 14
/
platformio.ini
533 lines (507 loc) · 16.7 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
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
# 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 STM32H7xx 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, the necessary changes
# can be made to any of the following sections (see examples below);
# - common settings, which will apply to all builds
# - feature specific settings that can be included per board
# - board specific settings
#
# 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 nucleo_h743_reference
# # 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 nucleo_h743_reference -t upload
# # Clean up build related resources
# pio run -t clean
#
[platformio]
include_dir = Inc
src_dir = Src
# Common build settings that apply to all environments, see my_machine.h for examples
[common]
build_flags =
-I .
-I boards
# Enable L1 cache and assocatied cache maintenance functions
-D L1_CACHE_ENABLE=1
# 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
-Wl,-u,_printf_float
-Wl,-u,_scanf_float
lib_deps =
grbl
boards
plugins
#bluetooth
#keypad
#laser
#motors
#trinamic
#odometer
#spindle
lib_extra_dirs =
.
# Build settings for SD card support, include in board environments as needed
[sdcard]
build_flags =
-D SDCARD_ENABLE=1
-I Middlewares/Third_Party/FatFs/src
-I FATFS/Target
-I FATFS/App
lib_deps =
sdcard
FATFS/App
FATFS/Target
Middlewares/Third_Party/FatFs
lib_extra_dirs =
# Build settings for USB serial support, include in board environments as needed
[usb]
build_flags =
-D USB_SERIAL_CDC=1
-I Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc
-I Middlewares/ST/STM32_USB_Device_Library/Core/Inc
-I USB_DEVICE/Target
-I USB_DEVICE/App
lib_deps =
USB_DEVICE/App
USB_DEVICE/Target
Middlewares/ST/STM32_USB_Device_Library/Class
Middlewares/ST/STM32_USB_Device_Library/Core
lib_extra_dirs =
# Build settings for H723 USB serial support, include in board environments as needed
# (STM32H723xx does not have a FS USB peripherial, using the HS peripheral in FS mode)
[usb_h723]
build_flags =
-D USB_SERIAL_CDC=1
-I Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc
-I Middlewares/ST/STM32_USB_Device_Library/Core/Inc
-I USB_DEVICE_H723/Target
-I USB_DEVICE_H723/App
lib_deps =
USB_DEVICE_H723/App
USB_DEVICE_H723/Target
Middlewares/ST/STM32_USB_Device_Library/Class
Middlewares/ST/STM32_USB_Device_Library/Core
lib_extra_dirs =
# Common build settings for networking support
[common_networking]
build_flags =
-D ETHERNET_ENABLE=1
-D TCP_ECHOSERVER_ENABLE=1
-D TELNET_ENABLE=1
-D WEBSOCKET_ENABLE=1
-D MDNS_ENABLE=1
# FTP & HTTP require SD card support
-D FTP_ENABLE=1
-D HTTP_ENABLE=1
-D WEBDAV_ENABLE=1
# Websockets moved to port 81 for WebUI
-D WEBUI_ENABLE=1
-D NETWORK_WEBSOCKET_PORT=81
-D TCP_MSS=1460
-D TCP_SND_BUF=5840 #(4*TCP_MSS)
-D MEM_SIZE=28672 #(28*1024)
-D LWIP_NUM_NETIF_CLIENT_DATA=2
-D LWIP_IGMP=1
-D LWIP_MDNS=1
-D LWIP_MDNS_RESPONDER=1
-D MDNS_MAX_SERVICES=8
-D LWIP_HTTPD_CUSTOM_FILES=0
-D LWIP_HTTPD_DYNAMIC_HEADERS=1
-D LWIP_HTTPD_DYNAMIC_FILE_READ=1
-D LWIP_HTTPD_SUPPORT_V09=0
-D LWIP_HTTPD_SUPPORT_11_KEEPALIVE=1
-D LWIP_HTTPD_SUPPORT_POST=1
-D HTTPD_LIMIT_SENDING_TO_2MSS=0
# Build settings for onboard Ethernet support, include in board environments as needed
[eth]
build_flags =
${common_networking.build_flags}
-I LWIP/App
-I LWIP/Target
-I Middlewares/Third_Party/LwIP/src/include
-I Middlewares/Third_Party/LwIP/system
-I Drivers/BSP/Components/lan8742
-I Middlewares/Third_Party/LwIP/src/include/netif
-I Middlewares/Third_Party/LwIP/src/include/lwip
lib_deps =
LWIP/App
LWIP/Target
networking
webui
Middlewares/Third_Party/LwIP
Drivers/BSP/Components/lan8742
lib_extra_dirs =
# Build settings for WIZnet Ethernet support, include in board environments as needed
[wiznet]
build_flags =
${common_networking.build_flags}
-I networking/wiznet
-I Middlewares/Third_Party/LwIP/system
-I Middlewares/Third_Party/LwIP/src/include
-I Middlewares/Third_Party/LwIP/src/include/netif
-I Middlewares/Third_Party/LwIP/src/include/lwip
lib_deps =
networking
webui
Middlewares/Third_Party/LwIP
lib_extra_dirs =
# Note: The platformio package registry does not yet include [email protected], which introduced
# the rewritten ST ethernet driver. We are therefore using a custom location for the framework, cloned
# from the official ST repo at https://github.com/STMicroelectronics/STM32CubeH7, with only minimal
# changes to remove unneeded content & add a package.json file.
[env]
platform = ststm32
platform_packages = framework-stm32cubeh7 @ https://github.com/dresco/STM32CubeH7.git
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
# Example Build Configurations
# Note: These will all be automatically built by GitHub actions on push to master branch.
# ST Nucleo H743ZI2 dev board, using reference board map
# Building with Ethernet and SD card support (microSD breakout required)
[env:nucleo_h743_reference]
board = nucleo_h743zi
board_build.f_cpu = 480000000L
board_build.ldscript = STM32H743ZITX_FLASH.ld
build_flags = ${common.build_flags}
${sdcard.build_flags}
${eth.build_flags}
# See Inc/my_machine.h for options
-D BOARD_REFERENCE=
-D NUCLEO_H743=
-D IS_NUCLEO_DEVKIT=1
-D HSE_VALUE=8000000
-D RTC_ENABLE=1
-D NUCLEO_SLOW_SDMMC_CLOCK=
lib_deps = ${common.lib_deps}
${sdcard.lib_deps}
${eth.lib_deps}
lib_extra_dirs = ${common.lib_extra_dirs}
${sdcard.lib_extra_dirs}
${eth.lib_extra_dirs}
# Alternatively, place the .pio/build/<env name>/firmware.bin on the NODE_H7xxZI drive
upload_protocol = stlink
# ST Nucleo H723ZG dev board, using reference board map
# Building with Ethernet and SD card support (microSD breakout required)
# Note: **building with USB CDC support, use 2nd USB port for console access**
[env:nucleo_h723_reference_cdc]
board = nucleo_h723zg
board_build.f_cpu = 480000000L
board_build.ldscript = STM32H723ZGTX_FLASH.ld
build_flags = ${common.build_flags}
${usb_h723.build_flags}
${sdcard.build_flags}
${eth.build_flags}
# See Inc/my_machine.h for options
-D BOARD_REFERENCE=
-D NUCLEO_H723=
-D IS_NUCLEO_DEVKIT=1
-D HSE_VALUE=8000000
-D RTC_ENABLE=1
-D NUCLEO_SLOW_SDMMC_CLOCK=
lib_deps = ${common.lib_deps}
${usb_h723.lib_deps}
${sdcard.lib_deps}
${eth.lib_deps}
lib_extra_dirs = ${common.lib_extra_dirs}
${usb_h723.lib_extra_dirs}
${sdcard.lib_extra_dirs}
${eth.lib_extra_dirs}
# Alternatively, place the .pio/build/<env name>/firmware.bin on the NODE_H7xxZI drive
upload_protocol = stlink
# WeAct MiniSTM32H743 with USB serial and SD card support
[env:weact_mini_h743_generic]
board = generic_stm32h743vi
board_build.ldscript = STM32H743VITX_FLASH.ld
build_flags = ${common.build_flags}
${usb.build_flags}
${sdcard.build_flags}
# See Inc/my_machine.h for options
-D BOARD_WEACT_MINI
-D HSE_VALUE=25000000
-D RTC_ENABLE=1
lib_deps = ${common.lib_deps}
${usb.lib_deps}
${sdcard.lib_deps}
lib_extra_dirs = ${common.lib_extra_dirs}
${usb.lib_extra_dirs}
${sdcard.lib_extra_dirs}
upload_protocol = stlink
debug_tool = stlink
# WeAct MiniSTM32H723 with USB serial and SD card support
[env:weact_mini_h723_generic]
board = generic_stm32h723vg
board_build.ldscript = STM32H723VGTX_FLASH.ld
build_flags = ${common.build_flags}
${usb_h723.build_flags}
${sdcard.build_flags}
# See Inc/my_machine.h for options
-D BOARD_WEACT_MINI
-D HSE_VALUE=25000000
-D RTC_ENABLE=1
lib_deps = ${common.lib_deps}
${usb_h723.lib_deps}
${sdcard.lib_deps}
lib_extra_dirs = ${common.lib_extra_dirs}
${usb_h723.lib_extra_dirs}
${sdcard.lib_extra_dirs}
upload_protocol = stlink
debug_tool = stlink
# dresco Octave (RevB 8-axis prototype board)
[env:dresco_octave_h723]
board = generic_stm32h723zg
board_build.ldscript = STM32H723ZGTX_FLASH.ld
build_flags = ${common.build_flags}
${usb_h723.build_flags}
${sdcard.build_flags}
${eth.build_flags}
# See Inc/my_machine.h for options
-D BOARD_DRESCO_OCTAVE
-D HSE_VALUE=25000000
-D EEPROM_ENABLE=64
-D EEPROM_IS_FRAM=1
-D SPINDLE0_ENABLE=SPINDLE_PWM0
# -D SPINDLE0_ENABLE=SPINDLE_HUANYANG1
# -D RTC_ENABLE=1
# -D PANEL_ENABLE=1
# -D CANBUS_ENABLE=1
# -D MODBUS_ENABLE=1
# -D MODBUS_MAX_ADU_SIZE=64
lib_deps = ${common.lib_deps}
${usb_h723.lib_deps}
${eth.lib_deps}
${sdcard.lib_deps}
eeprom
panel
spindle
#canbus
lib_extra_dirs = ${common.lib_extra_dirs}
${usb_h723.lib_extra_dirs}
${sdcard.lib_extra_dirs}
${eth.lib_extra_dirs}
upload_protocol = stlink
debug_tool = stlink
# BTT SKR 3 with USB serial, SD card, and Trinamic 2209 driver support
[env:btt_skr_30_h743_tmc2209]
board = generic_stm32h743vi
board_build.ldscript = STM32H743VITX_FLASH.ld
build_flags = ${common.build_flags}
${usb.build_flags}
${sdcard.build_flags}
# See Inc/my_machine.h for options
-D BOARD_BTT_SKR_30
-D HSE_VALUE=25000000
-D TRINAMIC_ENABLE=2209
lib_deps = ${common.lib_deps}
${usb.lib_deps}
${sdcard.lib_deps}
motors
trinamic
lib_extra_dirs = ${common.lib_extra_dirs}
${usb.lib_extra_dirs}
${sdcard.lib_extra_dirs}
upload_protocol = dfu
# BTT SKR 3 with USB serial, SD card, and Trinamic 2209 driver support -- 128KB bootloader
[env:btt_skr_30_h743_tmc2209_bl128]
board = generic_stm32h743vi
board_build.ldscript = STM32H743VITX_FLASH_BL.ld
build_flags = ${common.build_flags}
${usb.build_flags}
${sdcard.build_flags}
# See Inc/my_machine.h for options
-D BOARD_BTT_SKR_30
-D HSE_VALUE=25000000
-D TRINAMIC_ENABLE=2209
lib_deps = ${common.lib_deps}
${usb.lib_deps}
${sdcard.lib_deps}
motors
trinamic
lib_extra_dirs = ${common.lib_extra_dirs}
${usb.lib_extra_dirs}
${sdcard.lib_extra_dirs}
upload_protocol = dfu
# BTT SKR 3 with USB serial, SD card, and Trinamic 5160 driver support
[env:btt_skr_30_h743_tmc5160]
board = generic_stm32h743vi
board_build.ldscript = STM32H743VITX_FLASH.ld
build_flags = ${common.build_flags}
${usb.build_flags}
${sdcard.build_flags}
# See Inc/my_machine.h for options
-D BOARD_BTT_SKR_30
-D HSE_VALUE=25000000
-D TRINAMIC_ENABLE=5160
lib_deps = ${common.lib_deps}
${usb.lib_deps}
${sdcard.lib_deps}
motors
trinamic
lib_extra_dirs = ${common.lib_extra_dirs}
${usb.lib_extra_dirs}
${sdcard.lib_extra_dirs}
upload_protocol = dfu
# BTT SKR 3 with USB serial, SD card, and Trinamic 5160 driver support -- 128KB bootloader
[env:btt_skr_30_h743_tmc5160_bl128]
board = generic_stm32h743vi
board_build.ldscript = STM32H743VITX_FLASH_BL.ld
build_flags = ${common.build_flags}
${usb.build_flags}
${sdcard.build_flags}
# See Inc/my_machine.h for options
-D BOARD_BTT_SKR_30
-D HSE_VALUE=25000000
-D TRINAMIC_ENABLE=5160
lib_deps = ${common.lib_deps}
${usb.lib_deps}
${sdcard.lib_deps}
motors
trinamic
lib_extra_dirs = ${common.lib_extra_dirs}
${usb.lib_extra_dirs}
${sdcard.lib_extra_dirs}
upload_protocol = dfu
# BTT SKR 3 (H723 variant) with USB serial, SD card, and Trinamic 5160 driver support
[env:btt_skr_30_h723_tmc5160]
board = generic_stm32h723vg
board_build.ldscript = STM32H723VGTX_FLASH.ld
build_flags = ${common.build_flags}
${usb_h723.build_flags}
${sdcard.build_flags}
# See Inc/my_machine.h for options
-D BOARD_BTT_SKR_30
-D HSE_VALUE=25000000
-D TRINAMIC_ENABLE=5160
lib_deps = ${common.lib_deps}
${usb_h723.lib_deps}
${sdcard.lib_deps}
motors
trinamic
lib_extra_dirs = ${common.lib_extra_dirs}
${usb_h723.lib_extra_dirs}
${sdcard.lib_extra_dirs}
upload_protocol = dfu
# BTT SKR 3 (H723 variant) with USB serial, SD card, and Trinamic 5160 driver support -- 128KB bootloader
[env:btt_skr_30_h723_tmc5160_bl128]
board = generic_stm32h723vg
board_build.ldscript = STM32H723VGTX_FLASH_BL.ld
build_flags = ${common.build_flags}
${usb_h723.build_flags}
${sdcard.build_flags}
# See Inc/my_machine.h for options
-D BOARD_BTT_SKR_30
-D HSE_VALUE=25000000
-D TRINAMIC_ENABLE=5160
lib_deps = ${common.lib_deps}
${usb_h723.lib_deps}
${sdcard.lib_deps}
motors
trinamic
lib_extra_dirs = ${common.lib_extra_dirs}
${usb_h723.lib_extra_dirs}
${sdcard.lib_extra_dirs}
upload_protocol = dfu
# BTT Octopus Max (H723) with USB serial and Trinamic 5160 driver support
[env:btt_octopus_max_h723_tmc5160]
board = generic_stm32h723ze
board_build.ldscript = STM32H723ZETX_FLASH.ld
build_flags = ${common.build_flags}
${usb_h723.build_flags}
# See Inc/my_machine.h for options
-D BOARD_BTT_OCTOPUS_MAX
-D HSE_VALUE=25000000
-D TRINAMIC_ENABLE=5160
-D EEPROM_ENABLE=32
lib_deps = ${common.lib_deps}
${usb_h723.lib_deps}
motors
trinamic
eeprom
lib_extra_dirs = ${common.lib_extra_dirs}
${usb_h723.lib_extra_dirs}
upload_protocol = dfu
# BTT Octopus Max (H723) with USB serial and Trinamic 2209 driver support -- 128K bootloader
[env:btt_octopus_max_h723_tmc2209_bl128]
board = generic_stm32h723ze
board_build.ldscript = STM32H723ZETX_FLASH_BL.ld
build_flags = ${common.build_flags}
${usb_h723.build_flags}
# See Inc/my_machine.h for options
-D BOARD_BTT_OCTOPUS_MAX
-D HSE_VALUE=25000000
-D TRINAMIC_ENABLE=2209
-D EEPROM_ENABLE=32
lib_deps = ${common.lib_deps}
${usb_h723.lib_deps}
motors
trinamic
eeprom
lib_extra_dirs = ${common.lib_extra_dirs}
${usb_h723.lib_extra_dirs}
upload_protocol = dfu
# BTT Scylla (H723) with USB serial and Trinamic 5160 driver support
[env:btt_scylla_h723_tmc5160]
board = generic_stm32h723vg
board_build.ldscript = STM32H723VGTX_FLASH.ld
build_flags = ${common.build_flags}
${usb_h723.build_flags}
${sdcard.build_flags}
# See Inc/my_machine.h for options
-D BOARD_BTT_SCYLLA
-D HSE_VALUE=25000000
-D TRINAMIC_ENABLE=5160
lib_deps = ${common.lib_deps}
${usb_h723.lib_deps}
${sdcard.lib_deps}
motors
trinamic
lib_extra_dirs = ${common.lib_extra_dirs}
${usb_h723.lib_extra_dirs}
${sdcard.lib_extra_dirs}
upload_protocol = dfu
# BTT Scylla (H723) with USB serial and Trinamic 5160 support -- 128K bootloader
[env:btt_scylla_h723_tmc5160_bl128]
board = generic_stm32h723vg
board_build.ldscript = STM32H723VGTX_FLASH_BL.ld
build_flags = ${common.build_flags}
${usb_h723.build_flags}
${sdcard.build_flags}
# See Inc/my_machine.h for options
-D BOARD_BTT_SCYLLA
-D HSE_VALUE=25000000
-D TRINAMIC_ENABLE=5160
lib_deps = ${common.lib_deps}
${usb_h723.lib_deps}
${sdcard.lib_deps}
motors
trinamic
lib_extra_dirs = ${common.lib_extra_dirs}
${usb_h723.lib_extra_dirs}
${sdcard.lib_extra_dirs}
upload_protocol = dfu