Skip to content

Commit

Permalink
Normalize HAL/STM32 targets (MarlinFirmware#17904)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjasonsmith authored and Alexander Yasnogor committed Aug 7, 2020
1 parent c571feb commit a3aff47
Show file tree
Hide file tree
Showing 17 changed files with 124 additions and 22 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/test-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,19 @@ jobs:
- jgaurora_a5s_a1
- STM32F103VE_longer
- STM32F407VE_black
- STM32F401VE_STEVAL
- BIGTREE_BTT002
- BIGTREE_SKR_PRO
- BIGTREE_GTR_V1_0
- mks_robin
- ARMED
- FYSETC_S6
- STM32F070RB_malyan
- malyan_M300
- mks_robin_lite
- FLYF407ZG
- rumba32_f446ve
- rumba32_mks
- mks_robin_pro

# Put lengthy tests last
Expand All @@ -71,8 +77,6 @@ jobs:
#- STM32F7

# Non-working environment tests

#- BIGTREE_BTT002
#- at90usb1286_cdc
#- at90usb1286_dfu
#- STM32F103CB_malyan
Expand Down
1 change: 0 additions & 1 deletion buildroot/share/PlatformIO/boards/BigTree_Btt002.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"0x3748"
]
],
"ldscript": "stm32f407xg.ld",
"mcu": "stm32f407vgt6",
"variant": "BIGTREE_BTT002"
},
Expand Down
1 change: 0 additions & 1 deletion buildroot/share/PlatformIO/boards/BigTree_SKR_Pro.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"0x3748"
]
],
"ldscript": "stm32f407xg.ld",
"mcu": "stm32f407zgt6",
"variant": "BIGTREE_SKR_PRO_1v1"
},
Expand Down
1 change: 0 additions & 1 deletion buildroot/share/PlatformIO/boards/FLYF407ZG.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"0x3748"
]
],
"ldscript": "stm32f407xg.ld",
"mcu": "stm32f407zgt6",
"variant": "FLY_F407ZG"
},
Expand Down
1 change: 0 additions & 1 deletion buildroot/share/PlatformIO/boards/blackSTM32F407VET6.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"0x3748"
]
],
"ldscript": "stm32f407xe.ld",
"mcu": "stm32f407vet6",
"variant": "MARLIN_F407VE"
},
Expand Down
5 changes: 4 additions & 1 deletion buildroot/share/tests/ARMED-tests
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ set -e
#
# Build with the default configurations
#
restore_configs
use_example_configs ArmEd
exec_test $1 $2 "ArmEd Example Configuration"
opt_set X_DRIVER_TYPE TMC2130
opt_set Y_DRIVER_TYPE TMC2208
exec_test $1 $2 "ArmEd Example Configuration with mixed TMC Drivers"

# clean up
restore_configs
4 changes: 3 additions & 1 deletion buildroot/share/tests/BIGTREE_GTR_V1_0-tests
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ opt_set TEMP_SENSOR_7 1
opt_set E0_AUTO_FAN_PIN PC10
opt_set E1_AUTO_FAN_PIN PC11
opt_set E2_AUTO_FAN_PIN PC12
exec_test $1 $2 "BigTreeTech GTR 8 Extruders with Auto-Fan"
opt_set X_DRIVER_TYPE TMC2208
opt_set Y_DRIVER_TYPE TMC2130
exec_test $1 $2 "BigTreeTech GTR 8 Extruders with Auto-Fan and Mixed TMC Drivers"

restore_configs
opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0
Expand Down
3 changes: 2 additions & 1 deletion buildroot/share/tests/BIGTREE_SKR_PRO-tests
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ opt_set TEMP_SENSOR_2 1
opt_set E0_AUTO_FAN_PIN PC10
opt_set E1_AUTO_FAN_PIN PC11
opt_set E2_AUTO_FAN_PIN PC12
opt_set BLTOUCH Z_SAFE_HOMING
opt_set X_DRIVER_TYPE TMC2209
opt_set Y_DRIVER_TYPE TMC2130
exec_test $1 $2 "BigTreeTech SKR Pro 3 Extruders with Auto-Fan and mixed TMC drivers"
exec_test $1 $2 "BigTreeTech SKR Pro 3 Extruders, Auto-Fan, BLTOUCH, and mixed TMC drivers"

# clean up
restore_configs
18 changes: 18 additions & 0 deletions buildroot/share/tests/FLYF407ZG-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
#
# Build tests for FLYF407ZG
#

# exit on first failure
set -e

# Build examples
restore_configs
opt_set MOTHERBOARD BOARD_FLYF407ZG
opt_set SERIAL_PORT -1
opt_set X_DRIVER_TYPE TMC2208
opt_set Y_DRIVER_TYPE TMC2130
exec_test $1 $2 "FLYF407ZG Default Config with mixed TMC Drivers"

# cleanup
restore_configs
2 changes: 2 additions & 0 deletions buildroot/share/tests/FYSETC_S6-tests
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ set -e
# Build examples
restore_configs
use_example_configs FYSETC/S6
opt_set Y_DRIVER_TYPE TMC2209
opt_set Z_DRIVER_TYPE TMC2130
exec_test $1 $2 "FYSETC S6 Example"

# cleanup
Expand Down
15 changes: 15 additions & 0 deletions buildroot/share/tests/STM32F070RB_malyan-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env bash
#
# Build tests for STM32F070RB Malyan M200 v2
#

# exit on first failure
set -e

restore_configs
opt_set MOTHERBOARD BOARD_MALYAN_M200_V2
opt_set SERIAL_PORT -1
exec_test $1 $2 "Malyan M200 v2 Default Config"

# cleanup
restore_configs
16 changes: 16 additions & 0 deletions buildroot/share/tests/STM32F401VE_STEVAL-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
#
# Build tests for STM32F401VE_STEVAL
#

# exit on first failure
set -e

# Build examples
restore_configs
opt_set MOTHERBOARD BOARD_STEVAL_3DP001V1
opt_set SERIAL_PORT -1
exec_test $1 $2 "STM32F401VE_STEVAL Default Config"

# cleanup
restore_configs
1 change: 1 addition & 0 deletions buildroot/share/tests/STM32F407VE_black-tests
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# exit on first failure
set -e

restore_configs
use_example_configs STM32/Black_STM32F407VET6
opt_enable BAUD_RATE_GCODE
exec_test $1 $2 "Full-featured Sample Black STM32F407VET6 config"
Expand Down
1 change: 1 addition & 0 deletions buildroot/share/tests/malyan_M300-tests
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# exit on first failure
set -e

restore_configs
use_example_configs "delta/Malyan M300"
opt_disable AUTO_BED_LEVELING_3POINT
exec_test $1 $2 "Malyan M300 (delta)"
Expand Down
17 changes: 17 additions & 0 deletions buildroot/share/tests/rumba32_f446ve-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
#
# Build tests for rumba32_f446ve
#

# exit on first failure
set -e

# Build examples
restore_configs
opt_set MOTHERBOARD BOARD_RUMBA32_AUS3D
opt_set SERIAL_PORT -1
opt_set X_DRIVER_TYPE TMC2130
exec_test $1 $2 "rumba32_f446ve Default Config with TMC2130"

# cleanup
restore_configs
18 changes: 18 additions & 0 deletions buildroot/share/tests/rumba32_mks-tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash
#
# Build tests for rumba32_mks
#

# exit on first failure
set -e

# Build examples
restore_configs
opt_set MOTHERBOARD BOARD_RUMBA32_MKS
opt_set SERIAL_PORT -1
opt_set X_DRIVER_TYPE TMC2130
opt_set Y_DRIVER_TYPE TMC2208
exec_test $1 $2 "rumba32_mks Default Config with Mixed TMC Drivers"

# cleanup
restore_configs
34 changes: 21 additions & 13 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ boards_dir = buildroot/share/PlatformIO/boards
default_envs = mega2560

[common]
arduinoststm32_ver = >=4.10700,<4.10800
default_src_filter = +<src/*> -<src/config> -<src/HAL> +<src/HAL/shared>
extra_scripts = pre:buildroot/share/PlatformIO/scripts/common-cxxflags.py
build_flags = -fmax-errors=5 -g -D__MARLIN_FIRMWARE__ -fmerge-all-constants
Expand Down Expand Up @@ -470,6 +471,7 @@ src_filter = ${common.default_src_filter} +<src/HAL/STM32_F4_F7> -<src/HAL/ST
#
[env:ARMED]
platform = ststm32
platform_packages = framework-arduinoststm32@${common.arduinoststm32_ver}
board = armed_v1
build_flags = ${common.build_flags}
-DUSBCON -DUSBD_VID=0x0483 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="ARMED_V1"' -DUSBD_USE_CDC
Expand Down Expand Up @@ -638,12 +640,14 @@ lib_ignore = LiquidCrystal, LiquidTWI2, Adafruit NeoPixel, TMCStepper, U8glib-H
#
[env:STM32F070RB_malyan]
platform = ststm32
platform_packages = framework-arduinoststm32@${common.arduinoststm32_ver}
board = malyanM200v2
build_flags = -DSTM32F0xx -DUSBCON -DUSBD_VID=0x0483 '-DUSB_MANUFACTURER="Unknown"' '-DUSB_PRODUCT="ARMED_V1"' -DUSBD_USE_CDC -DHAL_PCD_MODULE_ENABLED
-O2 -ffreestanding -fsigned-char -fno-move-loop-invariants -fno-strict-aliasing -std=gnu11 -std=gnu++11
-DCUSTOM_STARTUP_FILE
-IMarlin/src/HAL/STM32
src_filter = ${common.default_src_filter} +<src/HAL/STM32>
lib_ignore = LiquidCrystal, LiquidTWI2, Adafruit NeoPixel, TMCStepper, U8glib-HAL
lib_ignore = LiquidCrystal, LiquidTWI2, Adafruit NeoPixel, TMCStepper, U8glib-HAL, SoftwareSerial

#
# Malyan M300 (STM32F070CB)
Expand Down Expand Up @@ -676,8 +680,8 @@ lib_ignore = Adafruit NeoPixel
#
[env:STM32F401VE_STEVAL]
platform = ststm32
platform_packages = framework-arduinoststm32@${common.arduinoststm32_ver}
board = STEVAL_STM32F401VE
platform_packages = framework-arduinoststm32@>=3.10700,<4
build_flags = ${common.build_flags}
-DTARGET_STM32F4 -DARDUINO_STEVAL -DSTM32F401xE
-DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -DUSB_PRODUCT=\"STEVAL_F401VE\"
Expand All @@ -694,15 +698,15 @@ src_filter = ${common.default_src_filter} +<src/HAL/STM32>
#
[env:FLYF407ZG]
platform = ststm32
platform_packages = framework-arduinoststm32@${common.arduinoststm32_ver}
board = FLYF407ZG
platform_packages = framework-arduinoststm32@>=3.10700,<4
build_flags = ${common.build_flags}
-DSTM32F4 -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -DUSB_PRODUCT=\"STM32F407ZG\"
-DTARGET_STM32F4 -DVECT_TAB_OFFSET=0x8000
-IMarlin/src/HAL/STM32
build_unflags = -std=gnu++11
extra_scripts = pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
lib_ignore = Adafruit NeoPixel, TMCStepper, SailfishLCD, SlowSoftI2CMaster, SoftwareSerial
lib_ignore = Adafruit NeoPixel, SailfishLCD, SlowSoftI2CMaster, SoftwareSerial
src_filter = ${common.default_src_filter} +<src/HAL/STM32>


Expand All @@ -711,10 +715,10 @@ src_filter = ${common.default_src_filter} +<src/HAL/STM32>
#
[env:FYSETC_S6]
platform = ststm32
board = fysetc_s6
platform_packages =
tool-stm32duino
framework-arduinoststm32@>=3.10700,<4
framework-arduinoststm32@${common.arduinoststm32_ver}
board = fysetc_s6
build_flags = ${common.build_flags}
-DTARGET_STM32F4 -std=gnu++14
-DVECT_TAB_OFFSET=0x10000
Expand All @@ -735,8 +739,8 @@ upload_protocol = serial
#
[env:STM32F407VE_black]
platform = ststm32
platform_packages = framework-arduinoststm32@${common.arduinoststm32_ver}
board = blackSTM32F407VET6
platform_packages = framework-arduinoststm32@>=3.10700,<4
build_flags = ${common.build_flags}
-DTARGET_STM32F4 -DARDUINO_BLACK_F407VE
-DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -DUSB_PRODUCT=\"BLACK_F407VE\"
Expand All @@ -752,8 +756,8 @@ src_filter = ${common.default_src_filter} +<src/HAL/STM32>
#
[env:BIGTREE_SKR_PRO]
platform = ststm32
platform_packages = framework-arduinoststm32@${common.arduinoststm32_ver}
board = BigTree_SKR_Pro
platform_packages = framework-arduinoststm32@>=3.10700,<4
build_flags = ${common.build_flags}
-DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -DUSB_PRODUCT=\"STM32F407ZG\"
-DTARGET_STM32F4 -DSTM32F407_5ZX -DVECT_TAB_OFFSET=0x8000
Expand All @@ -772,7 +776,7 @@ debug_init_break =
#
[env:BIGTREE_GTR_V1_0]
platform = ststm32@>=5.7.0
platform_packages = framework-arduinoststm32@>=3.10700,<4
platform_packages = framework-arduinoststm32@${common.arduinoststm32_ver}
board = BigTree_SKR_Pro
extra_scripts = pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
build_flags = ${common.build_flags}
Expand All @@ -794,8 +798,8 @@ src_filter = ${common.default_src_filter} +<src/HAL/STM32>
#
[env:BIGTREE_BTT002]
platform = [email protected]
platform_packages = framework-arduinoststm32@${common.arduinoststm32_ver}
board = BigTree_Btt002
platform_packages = framework-arduinoststm32@>=3.10700,<4
build_flags = ${common.build_flags}
-DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -DUSB_PRODUCT=\"STM32F407VG\"
-DTARGET_STM32F4 -DSTM32F407_5VX -DVECT_TAB_OFFSET=0x8000
Expand Down Expand Up @@ -883,6 +887,7 @@ debug_tool = jlink
#
[env:rumba32_f446ve]
platform = ststm32
platform_packages = framework-arduinoststm32@${common.arduinoststm32_ver}
board = rumba32_f446ve
build_flags = ${common.build_flags}
-DSTM32F4xx
Expand All @@ -899,7 +904,8 @@ build_flags = ${common.build_flags}
-DDISABLE_GENERIC_SERIALUSB
-DHAL_UART_MODULE_ENABLED
-Os
lib_ignore = Adafruit NeoPixel
-IMarlin/src/HAL/STM32
lib_ignore = Adafruit NeoPixel, SoftwareSerial
src_filter = ${common.default_src_filter} +<src/HAL/STM32>
monitor_speed = 500000
upload_protocol = dfu
Expand All @@ -909,6 +915,7 @@ upload_protocol = dfu
#
[env:rumba32_mks]
platform = ststm32
platform_packages = framework-arduinoststm32@${common.arduinoststm32_ver}
board = rumba32_f446ve
build_flags = ${common.build_flags}
-DSTM32F4xx -DARDUINO_RUMBA32_F446VE -DARDUINO_ARCH_STM32 "-DBOARD_NAME=\"RUMBA32_F446VE\""
Expand All @@ -920,8 +927,9 @@ build_flags = ${common.build_flags}
-DDISABLE_GENERIC_SERIALUSB
-DHAL_UART_MODULE_ENABLED
-Os
lib_ignore = Adafruit NeoPixel
src_filter = ${common.default_src_filter} +<src/HAL/STM32> +<src/HAL/STM32_F4_F7> -<src/HAL/STM32_F4_F7/STM32F7>
-IMarlin/src/HAL/STM32
lib_ignore = Adafruit NeoPixel, SoftwareSerial
src_filter = ${common.default_src_filter} +<src/HAL/STM32>
upload_protocol = dfu

#
Expand Down

0 comments on commit a3aff47

Please sign in to comment.