From 3be40c8c60b4a229518176e2a1d4c3409b56c886 Mon Sep 17 00:00:00 2001 From: robherc Date: Tue, 16 Jan 2024 02:04:46 -0500 Subject: [PATCH 1/5] Update DIAG pin/jumper warnings to only warn when diag pins may exist on a declared driver --- Marlin/src/core/drivers.h | 6 ++++++ Marlin/src/inc/Warnings.cpp | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Marlin/src/core/drivers.h b/Marlin/src/core/drivers.h index fce8a5a9b275..7b1b68004c0e 100644 --- a/Marlin/src/core/drivers.h +++ b/Marlin/src/core/drivers.h @@ -184,6 +184,12 @@ #if ANY_AXIS_HAS(SPI) #define HAS_TMC_SPI 1 #endif +#if HAS_STALLGUARD || HAS_DRIVER(TMC2160_STANDALONE) || HAS_DRIVER(TMC2130_STANDALONE) \ + || HAS_DRIVER(TMC2209_STANDALONE) || HAS_DRIVER(TMC26X) \ + || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) \ + || HAS_DRIVER(TMC5130_STANDALONE) || HAS_DRIVER(TMC5160_STANDALONE) + #define HAS_DIAG_DRIVER 1 +#endif // // TMC26XX Stepper Drivers diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 519bb7651a67..a1ab37c2566b 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -679,9 +679,9 @@ // Warn users of potential endstop/DIAG pin conflicts to prevent homing issues when not using sensorless homing // #if !USE_SENSORLESS - #if ENABLED(USES_DIAG_JUMPERS) && DISABLED(DIAG_JUMPERS_REMOVED) + #if ENABLED(USES_DIAG_JUMPERS) && HAS_DIAG_DRIVER && DISABLED(DIAG_JUMPERS_REMOVED) #warning "Motherboard DIAG jumpers must be removed when SENSORLESS_HOMING is disabled. (Define DIAG_JUMPERS_REMOVED to suppress this warning.)" - #elif ENABLED(USES_DIAG_PINS) && DISABLED(DIAG_PINS_REMOVED) + #elif ENABLED(USES_DIAG_PINS) && HAS_DIAG_DRIVER && DISABLED(DIAG_PINS_REMOVED) #warning "Driver DIAG pins must be physically removed unless SENSORLESS_HOMING is enabled. (See https://bit.ly/2ZPRlt0) (Define DIAG_PINS_REMOVED to suppress this warning.)" #endif #endif From b567903f674f96165128f61efcfb46638cbb6d6f Mon Sep 17 00:00:00 2001 From: Robherc <68039049+robherc@users.noreply.github.com> Date: Tue, 16 Jan 2024 09:08:43 -0500 Subject: [PATCH 2/5] Update Warnings.cpp --- Marlin/src/inc/Warnings.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index a1ab37c2566b..1ce4bf91c550 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -678,10 +678,10 @@ // // Warn users of potential endstop/DIAG pin conflicts to prevent homing issues when not using sensorless homing // -#if !USE_SENSORLESS - #if ENABLED(USES_DIAG_JUMPERS) && HAS_DIAG_DRIVER && DISABLED(DIAG_JUMPERS_REMOVED) +#if !USE_SENSORLESS && HAS_DIAG_DRIVER + #if ENABLED(USES_DIAG_JUMPERS) && DISABLED(DIAG_JUMPERS_REMOVED) #warning "Motherboard DIAG jumpers must be removed when SENSORLESS_HOMING is disabled. (Define DIAG_JUMPERS_REMOVED to suppress this warning.)" - #elif ENABLED(USES_DIAG_PINS) && HAS_DIAG_DRIVER && DISABLED(DIAG_PINS_REMOVED) + #elif ENABLED(USES_DIAG_PINS) && DISABLED(DIAG_PINS_REMOVED) #warning "Driver DIAG pins must be physically removed unless SENSORLESS_HOMING is enabled. (See https://bit.ly/2ZPRlt0) (Define DIAG_PINS_REMOVED to suppress this warning.)" #endif #endif From 57eeb973a40b8e536a18978faa44a473efc02fa1 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 4 Feb 2024 14:21:34 -0600 Subject: [PATCH 3/5] tweaks --- Marlin/src/core/drivers.h | 13 +++++-------- Marlin/src/inc/Warnings.cpp | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Marlin/src/core/drivers.h b/Marlin/src/core/drivers.h index 7b1b68004c0e..5bb246ce9e3e 100644 --- a/Marlin/src/core/drivers.h +++ b/Marlin/src/core/drivers.h @@ -120,6 +120,10 @@ #define HAS_TMC220x 1 #endif +#if HAS_DRIVER(TMC26X) + #define HAS_TMC26X 1 +#endif + #define AXIS_IS_TMC(A) ( AXIS_DRIVER_TYPE(A,TMC2130) || AXIS_DRIVER_TYPE(A,TMC2160) \ || AXIS_DRIVER_TYPE(A,TMC2208) || AXIS_DRIVER_TYPE(A,TMC2209) \ || AXIS_DRIVER_TYPE(A,TMC2660) \ @@ -188,12 +192,5 @@ || HAS_DRIVER(TMC2209_STANDALONE) || HAS_DRIVER(TMC26X) \ || HAS_DRIVER(TMC26X_STANDALONE) || HAS_DRIVER(TMC2660_STANDALONE) \ || HAS_DRIVER(TMC5130_STANDALONE) || HAS_DRIVER(TMC5160_STANDALONE) - #define HAS_DIAG_DRIVER 1 -#endif - -// -// TMC26XX Stepper Drivers -// -#if HAS_DRIVER(TMC26X) - #define HAS_TMC26X 1 + #define HAS_DIAG_PINS 1 #endif diff --git a/Marlin/src/inc/Warnings.cpp b/Marlin/src/inc/Warnings.cpp index 0a255beaae4d..c2c0e63a5240 100644 --- a/Marlin/src/inc/Warnings.cpp +++ b/Marlin/src/inc/Warnings.cpp @@ -678,7 +678,7 @@ // // Warn users of potential endstop/DIAG pin conflicts to prevent homing issues when not using sensorless homing // -#if !USE_SENSORLESS && HAS_DIAG_DRIVER +#if !USE_SENSORLESS && HAS_DIAG_PINS #if ENABLED(USES_DIAG_JUMPERS) && DISABLED(DIAG_JUMPERS_REMOVED) #warning "Motherboard DIAG jumpers must be removed when SENSORLESS_HOMING is disabled. (Define DIAG_JUMPERS_REMOVED to suppress this warning.)" #endif From 733d604708bcd027e0aa048fd4b4f3e62cbd853a Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 4 Feb 2024 15:30:06 -0600 Subject: [PATCH 4/5] Test for TMC26X --- buildroot/tests/FYSETC_F6 | 2 +- ini/features.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buildroot/tests/FYSETC_F6 b/buildroot/tests/FYSETC_F6 index 713408b550e2..861fbf029a63 100755 --- a/buildroot/tests/FYSETC_F6 +++ b/buildroot/tests/FYSETC_F6 @@ -45,7 +45,7 @@ exec_test $1 $2 "DELTA | UBL | Allen Key | EEPROM | OLED_PANEL_TINYBOY2..." "$3" restore_configs opt_set MOTHERBOARD BOARD_FYSETC_F6_13 \ LCD_LANGUAGE vi LCD_LANGUAGE_2 fr \ - X_DRIVER_TYPE TMC2160 Y_DRIVER_TYPE TMC5160 Z_DRIVER_TYPE TMC2208_STANDALONE E0_DRIVER_TYPE TMC2130 \ + X_DRIVER_TYPE TMC26X Y_DRIVER_TYPE TMC5160 Z_DRIVER_TYPE TMC2208_STANDALONE E0_DRIVER_TYPE TMC2130 \ X_MIN_ENDSTOP_HIT_STATE LOW Y_MIN_ENDSTOP_HIT_STATE LOW opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER \ MARLIN_BRICKOUT MARLIN_INVADERS MARLIN_SNAKE \ diff --git a/ini/features.ini b/ini/features.ini index 4baa2566f04d..6a808390be3f 100644 --- a/ini/features.ini +++ b/ini/features.ini @@ -28,7 +28,7 @@ SR_LCD_3W_NL = SailfishLCD=https://github.com/mikeshub HAS_MOTOR_CURRENT_(I2C|DAC|SPI|PWM) = build_src_filter=+ HAS_MOTOR_CURRENT_I2C = SlowSoftI2CMaster build_src_filter=+ -HAS_TMC26X = TMC26XStepper=https://github.com/MarlinFirmware/TMC26XStepper/archive/a7d7c92a13.zip +HAS_TMC26X = TMC26XStepper=https://github.com/MarlinFirmware/TMC26XStepper/archive/0.1.2.zip build_src_filter=+ LIB_INTERNAL_MAX31865 = build_src_filter=+ NEOPIXEL_LED = adafruit/Adafruit NeoPixel@~1.8.0 From b6cc9c7a2b2c7966b6fc6cfa8d5b63ed8b7cc75f Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sun, 4 Feb 2024 16:08:18 -0600 Subject: [PATCH 5/5] disable test --- buildroot/tests/FYSETC_F6 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildroot/tests/FYSETC_F6 b/buildroot/tests/FYSETC_F6 index 861fbf029a63..713408b550e2 100755 --- a/buildroot/tests/FYSETC_F6 +++ b/buildroot/tests/FYSETC_F6 @@ -45,7 +45,7 @@ exec_test $1 $2 "DELTA | UBL | Allen Key | EEPROM | OLED_PANEL_TINYBOY2..." "$3" restore_configs opt_set MOTHERBOARD BOARD_FYSETC_F6_13 \ LCD_LANGUAGE vi LCD_LANGUAGE_2 fr \ - X_DRIVER_TYPE TMC26X Y_DRIVER_TYPE TMC5160 Z_DRIVER_TYPE TMC2208_STANDALONE E0_DRIVER_TYPE TMC2130 \ + X_DRIVER_TYPE TMC2160 Y_DRIVER_TYPE TMC5160 Z_DRIVER_TYPE TMC2208_STANDALONE E0_DRIVER_TYPE TMC2130 \ X_MIN_ENDSTOP_HIT_STATE LOW Y_MIN_ENDSTOP_HIT_STATE LOW opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER \ MARLIN_BRICKOUT MARLIN_INVADERS MARLIN_SNAKE \