Browse Source

Let boards set Default TMC Slave Addresses (#20498)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
vanilla_fb_2.0.x
Keith Bennett 4 years ago
committed by GitHub
parent
commit
9a8f8f8284
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 32
      Marlin/Configuration_adv.h
  2. 48
      Marlin/src/inc/Conditionals_post.h
  3. 14
      Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_0.h
  4. 18
      Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h
  5. 18
      Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h
  6. 16
      Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h
  7. 4
      buildroot/tests/STM32F103RC_btt-tests

32
Marlin/Configuration_adv.h

@ -2473,22 +2473,22 @@
* Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers
* on the same serial port, either here or in your board's pins file. * on the same serial port, either here or in your board's pins file.
*/ */
#define X_SLAVE_ADDRESS 0 //#define X_SLAVE_ADDRESS 0
#define Y_SLAVE_ADDRESS 0 //#define Y_SLAVE_ADDRESS 0
#define Z_SLAVE_ADDRESS 0 //#define Z_SLAVE_ADDRESS 0
#define X2_SLAVE_ADDRESS 0 //#define X2_SLAVE_ADDRESS 0
#define Y2_SLAVE_ADDRESS 0 //#define Y2_SLAVE_ADDRESS 0
#define Z2_SLAVE_ADDRESS 0 //#define Z2_SLAVE_ADDRESS 0
#define Z3_SLAVE_ADDRESS 0 //#define Z3_SLAVE_ADDRESS 0
#define Z4_SLAVE_ADDRESS 0 //#define Z4_SLAVE_ADDRESS 0
#define E0_SLAVE_ADDRESS 0 //#define E0_SLAVE_ADDRESS 0
#define E1_SLAVE_ADDRESS 0 //#define E1_SLAVE_ADDRESS 0
#define E2_SLAVE_ADDRESS 0 //#define E2_SLAVE_ADDRESS 0
#define E3_SLAVE_ADDRESS 0 //#define E3_SLAVE_ADDRESS 0
#define E4_SLAVE_ADDRESS 0 //#define E4_SLAVE_ADDRESS 0
#define E5_SLAVE_ADDRESS 0 //#define E5_SLAVE_ADDRESS 0
#define E6_SLAVE_ADDRESS 0 //#define E6_SLAVE_ADDRESS 0
#define E7_SLAVE_ADDRESS 0 //#define E7_SLAVE_ADDRESS 0
/** /**
* Software enable * Software enable

48
Marlin/src/inc/Conditionals_post.h

@ -1647,6 +1647,54 @@
#ifndef E7_INTERPOLATE #ifndef E7_INTERPOLATE
#define E7_INTERPOLATE INTERPOLATE #define E7_INTERPOLATE INTERPOLATE
#endif #endif
#ifndef X_SLAVE_ADDRESS
#define X_SLAVE_ADDRESS 0
#endif
#ifndef Y_SLAVE_ADDRESS
#define Y_SLAVE_ADDRESS 0
#endif
#ifndef Z_SLAVE_ADDRESS
#define Z_SLAVE_ADDRESS 0
#endif
#ifndef X2_SLAVE_ADDRESS
#define X2_SLAVE_ADDRESS 0
#endif
#ifndef Y2_SLAVE_ADDRESS
#define Y2_SLAVE_ADDRESS 0
#endif
#ifndef Z2_SLAVE_ADDRESS
#define Z2_SLAVE_ADDRESS 0
#endif
#ifndef Z3_SLAVE_ADDRESS
#define Z3_SLAVE_ADDRESS 0
#endif
#ifndef Z4_SLAVE_ADDRESS
#define Z4_SLAVE_ADDRESS 0
#endif
#ifndef E0_SLAVE_ADDRESS
#define E0_SLAVE_ADDRESS 0
#endif
#ifndef E1_SLAVE_ADDRESS
#define E1_SLAVE_ADDRESS 0
#endif
#ifndef E2_SLAVE_ADDRESS
#define E2_SLAVE_ADDRESS 0
#endif
#ifndef E3_SLAVE_ADDRESS
#define E3_SLAVE_ADDRESS 0
#endif
#ifndef E4_SLAVE_ADDRESS
#define E4_SLAVE_ADDRESS 0
#endif
#ifndef E5_SLAVE_ADDRESS
#define E5_SLAVE_ADDRESS 0
#endif
#ifndef E6_SLAVE_ADDRESS
#define E6_SLAVE_ADDRESS 0
#endif
#ifndef E7_SLAVE_ADDRESS
#define E7_SLAVE_ADDRESS 0
#endif
#endif #endif
#if (HAS_E_DRIVER(TMC2660) \ #if (HAS_E_DRIVER(TMC2660) \

14
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_0.h

@ -34,4 +34,18 @@
#define Y_HARDWARE_SERIAL MSerial4 #define Y_HARDWARE_SERIAL MSerial4
#define Z_HARDWARE_SERIAL MSerial4 #define Z_HARDWARE_SERIAL MSerial4
#define E0_HARDWARE_SERIAL MSerial4 #define E0_HARDWARE_SERIAL MSerial4
// Default TMC slave addresses
#ifndef X_SLAVE_ADDRESS
#define X_SLAVE_ADDRESS 0
#endif
#ifndef Y_SLAVE_ADDRESS
#define Y_SLAVE_ADDRESS 2
#endif
#ifndef Z_SLAVE_ADDRESS
#define Z_SLAVE_ADDRESS 1
#endif
#ifndef E0_SLAVE_ADDRESS
#define E0_SLAVE_ADDRESS 3
#endif
#endif #endif

18
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h

@ -49,13 +49,27 @@
#define CONTROLLER_FAN_PIN FAN1_PIN #define CONTROLLER_FAN_PIN FAN1_PIN
#endif #endif
#if HAS_TMC_UART
/** /**
* TMC220x stepper drivers * TMC220x stepper drivers
* Hardware serial communication ports. * Hardware serial communication ports
*/ */
#if HAS_TMC_UART
#define X_HARDWARE_SERIAL MSerial4 #define X_HARDWARE_SERIAL MSerial4
#define Y_HARDWARE_SERIAL MSerial4 #define Y_HARDWARE_SERIAL MSerial4
#define Z_HARDWARE_SERIAL MSerial4 #define Z_HARDWARE_SERIAL MSerial4
#define E0_HARDWARE_SERIAL MSerial4 #define E0_HARDWARE_SERIAL MSerial4
// Default TMC slave addresses
#ifndef X_SLAVE_ADDRESS
#define X_SLAVE_ADDRESS 0
#endif
#ifndef Y_SLAVE_ADDRESS
#define Y_SLAVE_ADDRESS 2
#endif
#ifndef Z_SLAVE_ADDRESS
#define Z_SLAVE_ADDRESS 1
#endif
#ifndef E0_SLAVE_ADDRESS
#define E0_SLAVE_ADDRESS 3
#endif
#endif #endif

18
Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h

@ -87,19 +87,30 @@
#define E0_ENABLE_PIN PC13 #define E0_ENABLE_PIN PC13
#if HAS_TMC_UART #if HAS_TMC_UART
/** /**
* TMC2208/TMC2209 stepper drivers * TMC2208/TMC2209 stepper drivers
*/ */
//
// Hardware serial with switch // Hardware serial with switch
//
#define X_HARDWARE_SERIAL MSerial2 #define X_HARDWARE_SERIAL MSerial2
#define Y_HARDWARE_SERIAL MSerial2 #define Y_HARDWARE_SERIAL MSerial2
#define Z_HARDWARE_SERIAL MSerial2 #define Z_HARDWARE_SERIAL MSerial2
#define E0_HARDWARE_SERIAL MSerial2 #define E0_HARDWARE_SERIAL MSerial2
// Default TMC slave addresses
#ifndef X_SLAVE_ADDRESS
#define X_SLAVE_ADDRESS 0
#endif
#ifndef Y_SLAVE_ADDRESS
#define Y_SLAVE_ADDRESS 1
#endif
#ifndef Z_SLAVE_ADDRESS
#define Z_SLAVE_ADDRESS 2
#endif
#ifndef E0_SLAVE_ADDRESS
#define E0_SLAVE_ADDRESS 3
#endif
// The 4xTMC2209 module doesn't have a serial multiplexer and // The 4xTMC2209 module doesn't have a serial multiplexer and
// needs to set *_SLAVE_ADDRESS in Configuration_adv.h for X,Y,Z,E0 // needs to set *_SLAVE_ADDRESS in Configuration_adv.h for X,Y,Z,E0
#if HAS_DRIVER(TMC2208) #if HAS_DRIVER(TMC2208)
@ -110,7 +121,6 @@
// Reduce baud rate to improve software serial reliability // Reduce baud rate to improve software serial reliability
#define TMC_BAUD_RATE 19200 #define TMC_BAUD_RATE 19200
#endif #endif
// //

16
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h

@ -80,11 +80,27 @@
#define E0_DIR_PIN PC14 #define E0_DIR_PIN PC14
#define E0_ENABLE_PIN PC13 #define E0_ENABLE_PIN PC13
#if HAS_TMC_UART
#define X_HARDWARE_SERIAL MSerial2 #define X_HARDWARE_SERIAL MSerial2
#define Y_HARDWARE_SERIAL MSerial2 #define Y_HARDWARE_SERIAL MSerial2
#define Z_HARDWARE_SERIAL MSerial2 #define Z_HARDWARE_SERIAL MSerial2
#define E0_HARDWARE_SERIAL MSerial2 #define E0_HARDWARE_SERIAL MSerial2
// Default TMC slave addresses
#ifndef X_SLAVE_ADDRESS
#define X_SLAVE_ADDRESS 0
#endif
#ifndef Y_SLAVE_ADDRESS
#define Y_SLAVE_ADDRESS 1
#endif
#ifndef Z_SLAVE_ADDRESS
#define Z_SLAVE_ADDRESS 2
#endif
#ifndef E0_SLAVE_ADDRESS
#define E0_SLAVE_ADDRESS 3
#endif
#endif
// //
// Heaters / Fans // Heaters / Fans
// //

4
buildroot/tests/STM32F103RC_btt-tests

@ -17,10 +17,6 @@ opt_set X_DRIVER_TYPE TMC2209
opt_set Y_DRIVER_TYPE TMC2209 opt_set Y_DRIVER_TYPE TMC2209
opt_set Z_DRIVER_TYPE TMC2209 opt_set Z_DRIVER_TYPE TMC2209
opt_set E0_DRIVER_TYPE TMC2209 opt_set E0_DRIVER_TYPE TMC2209
opt_set X_SLAVE_ADDRESS 0
opt_set Y_SLAVE_ADDRESS 1
opt_set Z_SLAVE_ADDRESS 2
opt_set E0_SLAVE_ADDRESS 3
opt_enable PINS_DEBUGGING opt_enable PINS_DEBUGGING
exec_test $1 $2 "BigTreeTech SKR Mini E3 1.0 - Basic Config with TMC2209 HW Serial" "$3" exec_test $1 $2 "BigTreeTech SKR Mini E3 1.0 - Basic Config with TMC2209 HW Serial" "$3"

Loading…
Cancel
Save