Error: Unknown pin chip name 'tmc2660_stepper_x'

I’m new in klipper and trying to bring it up on my stm32f4-attached-to-duex5-3D-printer. I don’t have any endstops, and klipper refuses to work w/o endstop pins specified, so i tried to use my TMC2660’s stallguard instead as specified in the configuration documentation and examples. Now klipper complains about the chip missing, even though it’s all defined in the config. What am i doing wrong? Here’s the log:

Starting Klippy...
Args: ['/home/cnc/klipper/klippy/klippy.py', '/home/cnc/printer.cfg', '-l', '/tmp/klippy.log']
Git version: 'v0.9.1-518-gd6197964-dirty'
CPU: 1 core ARMv6-compatible processor rev 7 (v6l)
Python: '2.7.16 (default, Oct 10 2019, 22:02:15) \n[GCC 8.3.0]'
Start printer at Sat Jun  5 22:51:29 2021 (1622929889.3 88803.6)
===== Config file =====
[stepper_x]
step_pin = PB8
dir_pin = PC14
endstop_pin = tmc2660_stepper_x:virtual_endstop
microsteps = 16
rotation_distance = 40

[tmc2660 stepper_x]
cs_pin = PB9
spi_bus = spi2
run_current = 1.0
sense_resistor = 0.051

[stepper_y]
step_pin = PA0
dir_pin = PB7
endstop_pin = tmc2660_stepper_y:virtual_endstop
microsteps = 16
rotation_distance = 40

[tmc2660 stepper_y]
cs_pin = PA1
spi_bus = spi2
run_current = 1
sense_resistor = 0.051

[stepper_z]
step_pin = PB5
dir_pin = PA3
endstop_pin = tmc2660_stepper_z:virtual_endstop
microsteps = 16

[tmc2660 stepper_z]
cs_pin = PB4
spi_bus = spi2
run_current = 1
sense_resistor = 0.051

[extruder]
step_pin = PB2
dir_pin = PC14
endstop_pin = tmc2660_extruder:virtual_endstop
microsteps = 16
nozzle_diameter = 0.4
filament_diameter = 1.75
sensor_type = EPCOS 100K B57560G104F
min_temp = 0
max_temp = 280

[tmc2660 extruder]
cs_pin = PA6
spi_bus = spi2
run_current = 1
sense_resistor = 0.051

[mcu]
serial = /dev/ttyACM0

[printer]
kinematics = cartesian
max_velocity = 500
max_accel = 3000
max_z_velocity = 25
max_z_accel = 30

[virtual_sdcard]
path = ~/
=======================
Config error
Traceback (most recent call last):
  File "/home/cnc/klipper/klippy/klippy.py", line 157, in _connect
    self._read_config()
  File "/home/cnc/klipper/klippy/klippy.py", line 143, in _read_config
    m.add_printer_objects(config)
  File "/home/cnc/klipper/klippy/toolhead.py", line 589, in add_printer_objects
    config.get_printer().add_object('toolhead', ToolHead(config))
  File "/home/cnc/klipper/klippy/toolhead.py", line 256, in __init__
    self.kin = mod.load_kinematics(self, config)
  File "/home/cnc/klipper/klippy/kinematics/cartesian.py", line 142, in load_kinematics
    return CartKinematics(toolhead, config)
  File "/home/cnc/klipper/klippy/kinematics/cartesian.py", line 16, in __init__
    for n in 'xyz']
  File "/home/cnc/klipper/klippy/stepper.py", line 357, in LookupMultiRail
    rail = PrinterRail(config)
  File "/home/cnc/klipper/klippy/stepper.py", line 257, in __init__
    self.add_extra_stepper(config)
  File "/home/cnc/klipper/klippy/stepper.py", line 336, in add_extra_stepper
    mcu_endstop = ppins.setup_pin('endstop', config.get('endstop_pin'))
  File "/home/cnc/klipper/klippy/pins.py", line 256, in setup_pin
    pin_params = self.lookup_pin(pin_desc, can_invert, can_pullup)
  File "/home/cnc/klipper/klippy/pins.py", line 239, in lookup_pin
    pin_params = self.parse_pin(pin_desc, can_invert, can_pullup)
  File "/home/cnc/klipper/klippy/pins.py", line 224, in parse_pin
    raise error("Unknown pin chip name '%s'" % (chip_name,))
error: Unknown pin chip name 'tmc2660_stepper_x'

Please refer to klipper | Klipper is a 3d-printer firmware

You need to specify the diag_pin and stall guard threshold in the tmcXX sections, e.g.

[tmc2660 stepper_x]
...
diag_pin: your_diag_pin_here
driver_SGTHRS: xx

The tmc2660 doesn’t have a “diag” pin, and doesn’t support the tmc2130_stepper_x:virtual_endstop feature. If you really want to do sensorless homing on the tmc2660 there is some info at https://www.klipper3d.org/TMC_Drivers.html.

If you don’t want an endstop at all, currently the only solution is to use a “dummy pin” - an otherwise unused pin on the micro-controller.

-Kevin

I followed the documentation and set the endstop pins to the pin that SG_TST pins of TMC2660s are ORed together (i’m using a Duex5 board that does this to SG_TST pins because why not). Now klipper tells it won’t work because one pin is used multiple times.

Yes, unfortunately, the shared SG_TST pin on the Duet is not currently supported. It would require code changes to Klipper.

There was a similar discussion of this at: Allow sharing endstop pins with buttons by kageurufu · Pull Request #4076 · KevinOConnor/klipper · GitHub

-Kevin