Procházet zdrojové kódy

Let boards set Default TMC Slave Addresses (#20498)

Co-authored-by: Scott Lahteine <github@thinkyhead.com>
Keith Bennett před 4 roky
rodič
revize
9a8f8f8284
No account linked to committer's email address

+ 16
- 16
Marlin/Configuration_adv.h Zobrazit soubor

@@ -2473,22 +2473,22 @@
2473 2473
    * Set *_SERIAL_TX_PIN and *_SERIAL_RX_PIN to match for all drivers
2474 2474
    * on the same serial port, either here or in your board's pins file.
2475 2475
    */
2476
-  #define  X_SLAVE_ADDRESS 0
2477
-  #define  Y_SLAVE_ADDRESS 0
2478
-  #define  Z_SLAVE_ADDRESS 0
2479
-  #define X2_SLAVE_ADDRESS 0
2480
-  #define Y2_SLAVE_ADDRESS 0
2481
-  #define Z2_SLAVE_ADDRESS 0
2482
-  #define Z3_SLAVE_ADDRESS 0
2483
-  #define Z4_SLAVE_ADDRESS 0
2484
-  #define E0_SLAVE_ADDRESS 0
2485
-  #define E1_SLAVE_ADDRESS 0
2486
-  #define E2_SLAVE_ADDRESS 0
2487
-  #define E3_SLAVE_ADDRESS 0
2488
-  #define E4_SLAVE_ADDRESS 0
2489
-  #define E5_SLAVE_ADDRESS 0
2490
-  #define E6_SLAVE_ADDRESS 0
2491
-  #define E7_SLAVE_ADDRESS 0
2476
+  //#define  X_SLAVE_ADDRESS 0
2477
+  //#define  Y_SLAVE_ADDRESS 0
2478
+  //#define  Z_SLAVE_ADDRESS 0
2479
+  //#define X2_SLAVE_ADDRESS 0
2480
+  //#define Y2_SLAVE_ADDRESS 0
2481
+  //#define Z2_SLAVE_ADDRESS 0
2482
+  //#define Z3_SLAVE_ADDRESS 0
2483
+  //#define Z4_SLAVE_ADDRESS 0
2484
+  //#define E0_SLAVE_ADDRESS 0
2485
+  //#define E1_SLAVE_ADDRESS 0
2486
+  //#define E2_SLAVE_ADDRESS 0
2487
+  //#define E3_SLAVE_ADDRESS 0
2488
+  //#define E4_SLAVE_ADDRESS 0
2489
+  //#define E5_SLAVE_ADDRESS 0
2490
+  //#define E6_SLAVE_ADDRESS 0
2491
+  //#define E7_SLAVE_ADDRESS 0
2492 2492
 
2493 2493
   /**
2494 2494
    * Software enable

+ 48
- 0
Marlin/src/inc/Conditionals_post.h Zobrazit soubor

@@ -1647,6 +1647,54 @@
1647 1647
   #ifndef E7_INTERPOLATE
1648 1648
     #define E7_INTERPOLATE INTERPOLATE
1649 1649
   #endif
1650
+  #ifndef X_SLAVE_ADDRESS
1651
+    #define X_SLAVE_ADDRESS  0
1652
+  #endif
1653
+  #ifndef Y_SLAVE_ADDRESS
1654
+    #define Y_SLAVE_ADDRESS  0
1655
+  #endif
1656
+  #ifndef Z_SLAVE_ADDRESS
1657
+    #define Z_SLAVE_ADDRESS  0
1658
+  #endif
1659
+  #ifndef X2_SLAVE_ADDRESS
1660
+    #define X2_SLAVE_ADDRESS 0
1661
+  #endif
1662
+  #ifndef Y2_SLAVE_ADDRESS
1663
+    #define Y2_SLAVE_ADDRESS 0
1664
+  #endif
1665
+  #ifndef Z2_SLAVE_ADDRESS
1666
+    #define Z2_SLAVE_ADDRESS 0
1667
+  #endif
1668
+  #ifndef Z3_SLAVE_ADDRESS
1669
+    #define Z3_SLAVE_ADDRESS 0
1670
+  #endif
1671
+  #ifndef Z4_SLAVE_ADDRESS
1672
+    #define Z4_SLAVE_ADDRESS 0
1673
+  #endif
1674
+  #ifndef E0_SLAVE_ADDRESS
1675
+    #define E0_SLAVE_ADDRESS 0
1676
+  #endif
1677
+  #ifndef E1_SLAVE_ADDRESS
1678
+    #define E1_SLAVE_ADDRESS 0
1679
+  #endif
1680
+  #ifndef E2_SLAVE_ADDRESS
1681
+    #define E2_SLAVE_ADDRESS 0
1682
+  #endif
1683
+  #ifndef E3_SLAVE_ADDRESS
1684
+    #define E3_SLAVE_ADDRESS 0
1685
+  #endif
1686
+  #ifndef E4_SLAVE_ADDRESS
1687
+    #define E4_SLAVE_ADDRESS 0
1688
+  #endif
1689
+  #ifndef E5_SLAVE_ADDRESS
1690
+    #define E5_SLAVE_ADDRESS 0
1691
+  #endif
1692
+  #ifndef E6_SLAVE_ADDRESS
1693
+    #define E6_SLAVE_ADDRESS 0
1694
+  #endif
1695
+  #ifndef E7_SLAVE_ADDRESS
1696
+    #define E7_SLAVE_ADDRESS 0
1697
+  #endif
1650 1698
 #endif
1651 1699
 
1652 1700
 #if (HAS_E_DRIVER(TMC2660) \

+ 14
- 0
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V1_0.h Zobrazit soubor

@@ -34,4 +34,18 @@
34 34
   #define Y_HARDWARE_SERIAL  MSerial4
35 35
   #define Z_HARDWARE_SERIAL  MSerial4
36 36
   #define E0_HARDWARE_SERIAL MSerial4
37
+
38
+  // Default TMC slave addresses
39
+  #ifndef X_SLAVE_ADDRESS
40
+    #define X_SLAVE_ADDRESS  0
41
+  #endif
42
+  #ifndef Y_SLAVE_ADDRESS
43
+    #define Y_SLAVE_ADDRESS  2
44
+  #endif
45
+  #ifndef Z_SLAVE_ADDRESS
46
+    #define Z_SLAVE_ADDRESS  1
47
+  #endif
48
+  #ifndef E0_SLAVE_ADDRESS
49
+    #define E0_SLAVE_ADDRESS 3
50
+  #endif
37 51
 #endif

+ 18
- 4
Marlin/src/pins/stm32f1/pins_BTT_SKR_MINI_E3_V2_0.h Zobrazit soubor

@@ -49,13 +49,27 @@
49 49
   #define CONTROLLER_FAN_PIN               FAN1_PIN
50 50
 #endif
51 51
 
52
-/**
53
- * TMC220x stepper drivers
54
- * Hardware serial communication ports.
55
- */
56 52
 #if HAS_TMC_UART
53
+  /**
54
+   * TMC220x stepper drivers
55
+   * Hardware serial communication ports
56
+   */
57 57
   #define X_HARDWARE_SERIAL  MSerial4
58 58
   #define Y_HARDWARE_SERIAL  MSerial4
59 59
   #define Z_HARDWARE_SERIAL  MSerial4
60 60
   #define E0_HARDWARE_SERIAL MSerial4
61
+
62
+  // Default TMC slave addresses
63
+  #ifndef X_SLAVE_ADDRESS
64
+    #define X_SLAVE_ADDRESS  0
65
+  #endif
66
+  #ifndef Y_SLAVE_ADDRESS
67
+    #define Y_SLAVE_ADDRESS  2
68
+  #endif
69
+  #ifndef Z_SLAVE_ADDRESS
70
+    #define Z_SLAVE_ADDRESS  1
71
+  #endif
72
+  #ifndef E0_SLAVE_ADDRESS
73
+    #define E0_SLAVE_ADDRESS 3
74
+  #endif
61 75
 #endif

+ 14
- 4
Marlin/src/pins/stm32f1/pins_FYSETC_AIO_II.h Zobrazit soubor

@@ -87,19 +87,30 @@
87 87
 #define E0_ENABLE_PIN                       PC13
88 88
 
89 89
 #if HAS_TMC_UART
90
-
91 90
   /**
92 91
    * TMC2208/TMC2209 stepper drivers
93 92
    */
94 93
 
95
-  //
96 94
   // Hardware serial with switch
97
-  //
98 95
   #define X_HARDWARE_SERIAL  MSerial2
99 96
   #define Y_HARDWARE_SERIAL  MSerial2
100 97
   #define Z_HARDWARE_SERIAL  MSerial2
101 98
   #define E0_HARDWARE_SERIAL MSerial2
102 99
 
100
+  // Default TMC slave addresses
101
+  #ifndef X_SLAVE_ADDRESS
102
+    #define X_SLAVE_ADDRESS  0
103
+  #endif
104
+  #ifndef Y_SLAVE_ADDRESS
105
+    #define Y_SLAVE_ADDRESS  1
106
+  #endif
107
+  #ifndef Z_SLAVE_ADDRESS
108
+    #define Z_SLAVE_ADDRESS  2
109
+  #endif
110
+  #ifndef E0_SLAVE_ADDRESS
111
+    #define E0_SLAVE_ADDRESS 3
112
+  #endif
113
+
103 114
   // The 4xTMC2209 module doesn't have a serial multiplexer and
104 115
   // needs to set *_SLAVE_ADDRESS in Configuration_adv.h for X,Y,Z,E0
105 116
   #if HAS_DRIVER(TMC2208)
@@ -110,7 +121,6 @@
110 121
 
111 122
   // Reduce baud rate to improve software serial reliability
112 123
   #define TMC_BAUD_RATE                    19200
113
-
114 124
 #endif
115 125
 
116 126
 //

+ 20
- 4
Marlin/src/pins/stm32f1/pins_FYSETC_CHEETAH.h Zobrazit soubor

@@ -80,10 +80,26 @@
80 80
 #define E0_DIR_PIN                          PC14
81 81
 #define E0_ENABLE_PIN                       PC13
82 82
 
83
-#define X_HARDWARE_SERIAL  MSerial2
84
-#define Y_HARDWARE_SERIAL  MSerial2
85
-#define Z_HARDWARE_SERIAL  MSerial2
86
-#define E0_HARDWARE_SERIAL MSerial2
83
+#if HAS_TMC_UART
84
+  #define X_HARDWARE_SERIAL  MSerial2
85
+  #define Y_HARDWARE_SERIAL  MSerial2
86
+  #define Z_HARDWARE_SERIAL  MSerial2
87
+  #define E0_HARDWARE_SERIAL MSerial2
88
+
89
+  // Default TMC slave addresses
90
+  #ifndef X_SLAVE_ADDRESS
91
+    #define X_SLAVE_ADDRESS  0
92
+  #endif
93
+  #ifndef Y_SLAVE_ADDRESS
94
+    #define Y_SLAVE_ADDRESS  1
95
+  #endif
96
+  #ifndef Z_SLAVE_ADDRESS
97
+    #define Z_SLAVE_ADDRESS  2
98
+  #endif
99
+  #ifndef E0_SLAVE_ADDRESS
100
+    #define E0_SLAVE_ADDRESS 3
101
+  #endif
102
+#endif
87 103
 
88 104
 //
89 105
 // Heaters / Fans

+ 0
- 4
buildroot/tests/STM32F103RC_btt-tests Zobrazit soubor

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

Loading…
Zrušit
Uložit