From cc822bf70fd4683a00fcf5c3ea5b5e6a62a0d10b Mon Sep 17 00:00:00 2001 From: Jason Smith Date: Sun, 1 Mar 2020 19:19:02 -0800 Subject: [PATCH] Fix some 8 extruders issues, GTR build (#17043) --- .github/workflows/test-builds.yml | 1 + Marlin/src/inc/Conditionals_LCD.h | 4 +- Marlin/src/module/temperature.cpp | 8 ++-- Marlin/src/pins/pins.h | 2 +- Marlin/src/pins/sensitive_pins.h | 6 +-- Marlin/src/pins/stm32/pins_BTT_GTR_V1_0.h | 8 ++-- buildroot/share/tests/BIGTREE_GTR_V1_0-tests | 39 ++++++++++++++++++++ platformio.ini | 3 +- 8 files changed, 56 insertions(+), 15 deletions(-) create mode 100644 buildroot/share/tests/BIGTREE_GTR_V1_0-tests diff --git a/.github/workflows/test-builds.yml b/.github/workflows/test-builds.yml index 59722e3ca5..be38685736 100644 --- a/.github/workflows/test-builds.yml +++ b/.github/workflows/test-builds.yml @@ -53,6 +53,7 @@ jobs: - STM32F103VE_longer - STM32F407VE_black - BIGTREE_SKR_PRO + - BIGTREE_GTR_V1_0 - mks_robin - ARMED - FYSETC_S6 diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index 640bae93a8..b4da3439bb 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -443,9 +443,9 @@ // Helper macros for extruder and hotend arrays #define HOTEND_LOOP() for (int8_t e = 0; e < HOTENDS; e++) #define ARRAY_BY_EXTRUDERS(V...) ARRAY_N(EXTRUDERS, V) -#define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1, v1, v1) +#define ARRAY_BY_EXTRUDERS1(v1) ARRAY_BY_EXTRUDERS(v1, v1, v1, v1, v1, v1, v1, v1) #define ARRAY_BY_HOTENDS(V...) ARRAY_N(HOTENDS, V) -#define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1) +#define ARRAY_BY_HOTENDS1(v1) ARRAY_BY_HOTENDS(v1, v1, v1, v1, v1, v1, v1, v1) #define DO_SWITCH_EXTRUDER (ENABLED(SWITCHING_EXTRUDER) && (DISABLED(SWITCHING_NOZZLE) || SWITCHING_EXTRUDER_SERVO_NR != SWITCHING_NOZZLE_SERVO_NR)) #define SWITCHING_NOZZLE_TWO_SERVOS defined(SWITCHING_NOZZLE_E1_SERVO_NR) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index c9547b3e9f..73a91049da 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -101,11 +101,13 @@ #if HOTEND_USES_THERMISTOR #if ENABLED(TEMP_SENSOR_1_AS_REDUNDANT) - static void* heater_ttbl_map[2] = { (void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE }; + static const void* heater_ttbl_map[2] = { (void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE }; static constexpr uint8_t heater_ttbllen_map[2] = { HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN }; #else - static void* heater_ttbl_map[HOTENDS] = ARRAY_BY_HOTENDS((void*)HEATER_0_TEMPTABLE, (void*)HEATER_1_TEMPTABLE, (void*)HEATER_2_TEMPTABLE, (void*)HEATER_3_TEMPTABLE, (void*)HEATER_4_TEMPTABLE, (void*)HEATER_5_TEMPTABLE); - static constexpr uint8_t heater_ttbllen_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE_LEN, HEATER_1_TEMPTABLE_LEN, HEATER_2_TEMPTABLE_LEN, HEATER_3_TEMPTABLE_LEN, HEATER_4_TEMPTABLE_LEN, HEATER_5_TEMPTABLE_LEN); + #define NEXT_TEMPTABLE(N) ,HEATER_##N##_TEMPTABLE + #define NEXT_TEMPTABLE_LEN(N) ,HEATER_##N##_TEMPTABLE_LEN + static const void* heater_ttbl_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE REPEAT_S(1, HOTENDS, NEXT_TEMPTABLE)); + static constexpr uint8_t heater_ttbllen_map[HOTENDS] = ARRAY_BY_HOTENDS(HEATER_0_TEMPTABLE_LEN REPEAT_S(1, HOTENDS, NEXT_TEMPTABLE_LEN)); #endif #endif diff --git a/Marlin/src/pins/pins.h b/Marlin/src/pins/pins.h index ce03a3468d..920c124a5c 100644 --- a/Marlin/src/pins/pins.h +++ b/Marlin/src/pins/pins.h @@ -35,7 +35,7 @@ * These numbers are the same in any pin mapping. */ -#define MAX_EXTRUDERS 6 +#define MAX_EXTRUDERS 8 #if MB(RAMPS_13_EFB, RAMPS_14_EFB, RAMPS_PLUS_EFB, RAMPS_14_RE_ARM_EFB, RAMPS_SMART_EFB, RAMPS_DUO_EFB, RAMPS4DUE_EFB) #define IS_RAMPS_EFB diff --git a/Marlin/src/pins/sensitive_pins.h b/Marlin/src/pins/sensitive_pins.h index 807ee99e23..180bc8d6f6 100644 --- a/Marlin/src/pins/sensitive_pins.h +++ b/Marlin/src/pins/sensitive_pins.h @@ -278,9 +278,9 @@ #endif #define _E6_CS +#define _E6_MS1 #define _E6_MS2 #define _E6_MS3 -#define _E6_MS4 #if E_NEEDED(6) #if PIN_EXISTS(E6_CS) && AXIS_HAS_SPI(E6) @@ -302,9 +302,9 @@ #endif #define _E7_CS +#define _E7_MS1 +#define _E7_MS2 #define _E7_MS3 -#define _E7_MS4 -#define _E7_MS5 #if E_NEEDED(7) #if PIN_EXISTS(E7_CS) && AXIS_HAS_SPI(E7) diff --git a/Marlin/src/pins/stm32/pins_BTT_GTR_V1_0.h b/Marlin/src/pins/stm32/pins_BTT_GTR_V1_0.h index aa2152c84f..0500c5d953 100644 --- a/Marlin/src/pins/stm32/pins_BTT_GTR_V1_0.h +++ b/Marlin/src/pins/stm32/pins_BTT_GTR_V1_0.h @@ -237,8 +237,8 @@ #define TEMP_3_PIN PA3 // T4 <-> E3 #define TEMP_4_PIN PF9 // T5 <-> E4 #define TEMP_5_PIN PF10 // T6 <-> E5 -//#define TEMP_6_PIN PF7 // T7 <-> E6 -//#define TEMP_7_PIN PF5 // T8 <-> E7 +#define TEMP_6_PIN PF7 // T7 <-> E6 +#define TEMP_7_PIN PF5 // T8 <-> E7 #define TEMP_BED_PIN PC0 // T0 <-> Bed @@ -266,8 +266,8 @@ #define HEATER_3_PIN PD15 // Heater3 #define HEATER_4_PIN PD13 // Heater4 #define HEATER_5_PIN PD12 // Heater5 -//#define HEATER_6_PIN PE13 // Heater6 -//#define HEATER_7_PIN PI6 // Heater7 +#define HEATER_6_PIN PE13 // Heater6 +#define HEATER_7_PIN PI6 // Heater7 #define HEATER_BED_PIN PA2 // Hotbed diff --git a/buildroot/share/tests/BIGTREE_GTR_V1_0-tests b/buildroot/share/tests/BIGTREE_GTR_V1_0-tests new file mode 100644 index 0000000000..0738a2818b --- /dev/null +++ b/buildroot/share/tests/BIGTREE_GTR_V1_0-tests @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# +# Build tests for BigTreeTech GTR 1.0 +# + +# exit on first failure +set -e + +restore_configs +opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 +opt_set SERIAL_PORT -1 +opt_set EXTRUDERS 8 +opt_set TEMP_SENSOR_1 1 +opt_set TEMP_SENSOR_2 1 +opt_set TEMP_SENSOR_3 1 +opt_set TEMP_SENSOR_4 1 +opt_set TEMP_SENSOR_5 1 +opt_set TEMP_SENSOR_6 1 +opt_set TEMP_SENSOR_7 1 +# Not necessary to enable auto-fan for all extruders to hit problematic code paths +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" + +restore_configs +opt_set MOTHERBOARD BOARD_BTT_GTR_V1_0 +opt_set SERIAL_PORT -1 +opt_set EXTRUDERS 6 +opt_set TEMP_SENSOR_1 1 +opt_set TEMP_SENSOR_2 1 +opt_set TEMP_SENSOR_3 1 +opt_set TEMP_SENSOR_4 1 +opt_set TEMP_SENSOR_5 1 +opt_set NUM_Z_STEPPER_DRIVERS 3 +exec_test $1 $2 "BigTreeTech GTR 6 Extruders Triple Z" + +# clean up +restore_configs diff --git a/platformio.ini b/platformio.ini index 405efd8624..f69842cafe 100644 --- a/platformio.ini +++ b/platformio.ini @@ -681,13 +681,12 @@ debug_init_break = [env:BIGTREE_GTR_V1_0] platform = ststm32@>=5.7.0 framework = arduino -platform_packages = framework-arduinoststm32@>=3.10700.191028 +platform_packages = framework-arduinoststm32@>=3.107,<4 board = BigTree_SKR_Pro extra_scripts = pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py build_flags = ${common.build_flags} -DUSBCON -DUSBD_USE_CDC -DUSBD_VID=0x0483 -DUSB_PRODUCT=\"STM32F407IG\" -DTARGET_STM32F4 -DSTM32F407IX -DVECT_TAB_OFFSET=0x8000 - -IMarlin/src/HAL/HAL_STM32 lib_deps = U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/bugfix.zip