Klipper3d / klipper

Klipper is a 3d-printer firmware
GNU General Public License v3.0
9.33k stars 5.28k forks source link

Unable to connect to SKR 1.4 Turbo #3050

Closed kondas closed 4 years ago

kondas commented 4 years ago

Hello everybody. I'm trying to get Klipper working on my SKR 1.4 Turbo mainboard. My goal would be to use the rPi UART0 @ 250000 Baud, but I've tried via USB-serial and rPi UART0 without success. It looks like that after a successful flash, klippy logs are flooded with timeout messages regarding the serial connection

Wait for identify_response
Traceback (most recent call last):
  File "/home/pi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/pi/klipper/klippy/serialhdl.py", line 186, in send_with_response
    return src.get_response(cmd, self.default_cmd_queue)
  File "/home/pi/klipper/klippy/serialhdl.py", line 242, in get_response
    self.serial.raw_send_wait_ack(cmd, minclock, minclock, cmd_queue)
  File "/home/pi/klipper/klippy/serialhdl.py", line 178, in raw_send_wait_ack
    raise error("Serial connection closed")
error: Serial connection closed

I've tried changing the usb device ID in klipper config, but doesn't help. Also changed baud from 250000 to 115200, without success. I've tried searching for issues with this board, but haven't found similar. Others reportedly using it both via USB - serial, and also rPi UART0. But i also see that their USB device descriptor is different.

Can somebody please help me what am i doing wrong? I'd love to try Klipper on my big delta.

USB Device info

Bus 001 Device 008: ID 1d50:6029 OpenMoko, Inc.
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          239 Miscellaneous Device
  bDeviceSubClass         2
  bDeviceProtocol         1 Interface Association
  bMaxPacketSize0        64
  idVendor           0x1d50 OpenMoko, Inc.
  idProduct          0x6029
  bcdDevice            1.00
  iManufacturer           1 marlinfw.org
  iProduct                2 Marlin USB Device
  iSerial                 3 0D006023AF4A1C875D7C39AEF50020C7
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0062
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Association:
      bLength                 8
      bDescriptorType        11
      bFirstInterface         0
      bInterfaceCount         2
      bFunctionClass          2 Communications
      bFunctionSubClass       2 Abstract (modem)
      bFunctionProtocol       1 AT-commands (v.25ter)
      iFunction               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         2 Communications
      bInterfaceSubClass      2 Abstract (modem)
      bInterfaceProtocol      0
      iInterface              0
      CDC Header:
        bcdCDC               1.10
      CDC Call Management:
        bmCapabilities       0x03
          call management
          use DataInterface
        bDataInterface          1
      CDC ACM:
        bmCapabilities       0x06
          sends break
          line coding and serial state
      CDC Union:
        bMasterInterface        0
        bSlaveInterface         1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval              16
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass        10 CDC Data
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x85  EP 5 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x05  EP 5 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)

Klipper Log:

 Build file /home/pi/klipper/klippy/../.config(1132): Fri Jul  3 22:49:47 2020
========= Last MCU build config =========
#
# Automatically generated file; DO NOT EDIT.
# Klipper Firmware Configuration
#
CONFIG_LOW_LEVEL_OPTIONS=y
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
CONFIG_MACH_LPC176X=y
# CONFIG_MACH_STM32 is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_STEP_DELAY=2
CONFIG_BOARD_DIRECTORY="lpc176x"
CONFIG_MCU="lpc1769"
CONFIG_CLOCK_FREQ=120000000
CONFIG_USBSERIAL=y
CONFIG_FLASH_START=0x4000
CONFIG_FLASH_SIZE=0x80000
CONFIG_RAM_START=0x10000000
CONFIG_RAM_SIZE=0x7fe0
CONFIG_STACK_SIZE=512
CONFIG_LPC_SELECT=y
# CONFIG_MACH_LPC1768 is not set
CONFIG_MACH_LPC1769=y
CONFIG_SMOOTHIEWARE_BOOTLOADER=y
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x6029
CONFIG_USB_SERIAL_NUMBER_CHIPID=y
CONFIG_USB_SERIAL_NUMBER="12345"

#
# USB ids
#
# CONFIG_CUSTOM_STEP_DELAY is not set
CONFIG_INITIAL_PINS=""
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
CONFIG_HAVE_GPIO_I2C=y
# CONFIG_HAVE_GPIO_HARD_PWM is not set
CONFIG_HAVE_GPIO_BITBANGING=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_INLINE_STEPPER_HACK=y
=======================
Build file /home/pi/klipper/klippy/../out/klipper.dict(5625): Fri Jul  3 22:50:01 2020
Last MCU build version: v0.8.0-619-g7bc64700-20200703_225001-octoprint
Last MCU build tools: gcc: (15:7-2018-q2-6) 7.3.1 20180622 (release) [ARM/embedded-7-branch revision 261907] binutils: (2.31.1-11+rpi1+11) 2.31.1
Last MCU build config: BUS_PINS_i2c1=P0.1,P0.0 BUS_PINS_i2c0=P0.28,P0.27 BUS_PINS_i2c2=P0.11,P0.10 BUS_PINS_i2c1a=P0.20,P0.19 BUS_PINS_ssp1=P0.8,P0.9,P0.7 STEP_DELAY=2 ADC_MAX=4095 BUS_PINS_ssp0=P0.17,P0.18,P0.15 RESERVE_PINS_USB=P0.30,P0.29,P2.9 CLOCK_FREQ=120000000 MCU=lpc1769 STATS_SUMSQ_BASE=256
Build file /home/pi/klipper/klippy/../out/klipper.elf(99736): Fri Jul  3 22:50:04 2020
Starting Klippy...
Args: ['/home/pi/klipper/klippy/klippy.py', '/home/pi/printer.cfg', '-l', '/tmp/klippy.log']
Git version: 'v0.8.0-619-g7bc64700'
CPU: 4 core ARMv7 Processor rev 3 (v7l)
Python: '2.7.16 (default, Oct 10 2019, 22:02:15) \n[GCC 8.3.0]'
Start printer at Fri Jul  3 22:57:37 2020 (1593813457.6 2688.4)
===== Config file =====
[stepper_x]
step_pin = P2.2
dir_pin = P2.6
enable_pin = !P2.1
step_distance = .0125
endstop_pin = !P1.29
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_y]
step_pin = P0.19
dir_pin = P0.20
enable_pin = !P2.8
step_distance = .0125
endstop_pin = !P1.28
position_endstop = 0
position_max = 235
homing_speed = 50

[stepper_z]
step_pin = P0.22
dir_pin = !P2.11
enable_pin = !P0.21
step_distance = .0025
endstop_pin = !P1.27
position_endstop = 0.0
position_max = 300

[extruder]
step_pin = P2.13
dir_pin = !P0.11
enable_pin = !P2.12
step_distance = .010526
nozzle_diameter = 0.400
filament_diameter = 1.750
heater_pin = P2.7
sensor_type = EPCOS 100K B57560G104F
sensor_pin = P0.24
control = pid
pid_kp = 22.2
pid_ki = 1.08
pid_kd = 114
min_temp = 0
max_temp = 260

[heater_bed]
heater_pin = P2.5
sensor_type = EPCOS 100K B57560G104F
sensor_pin = P0.25
control = pid
pid_kp = 54.027
pid_ki = 0.770
pid_kd = 948.182
min_temp = 0
max_temp = 130

[fan]
pin = P2.3

[mcu]
serial = /dev/serial/by-id/usb-marlinfw.org_Marlin_USB_Device_0D006023AF4A1C875D7C39AEF50020C7-if00
baud = 115200

[printer]
kinematics = cartesian
max_velocity = 400
max_accel = 500
max_z_velocity = 10
max_z_accel = 100

[tmc2208 stepper_x]
uart_pin = P1.10
microsteps = 16
run_current = 0.800
hold_current = 0.500
stealthchop_threshold = 250

[tmc2208 stepper_y]
uart_pin = P1.9
microsteps = 16
run_current = 0.800
hold_current = 0.500
stealthchop_threshold = 250

[tmc2208 stepper_z]
uart_pin = P1.8
microsteps = 16
run_current = 0.650
hold_current = 0.450
stealthchop_threshold = 30

[tmc2208 extruder]
uart_pin = P1.4
microsteps = 16
run_current = 0.800
hold_current = 0.500
stealthchop_threshold = 60

[board_pins]
aliases =
    EXP1_1=P1.30, EXP1_3=P1.18, EXP1_5=P1.20, EXP1_7=P1.22, EXP1_9=<GND>,
    EXP1_2=P0.28, EXP1_4=P1.19, EXP1_6=P1.21, EXP1_8=P1.23, EXP1_10=<5V>,
    EXP2_1=P0.17, EXP2_3=P3.26, EXP2_5=P3.25, EXP2_7=P1.31, EXP2_9=<GND>,
    EXP2_2=P0.15, EXP2_4=P0.16, EXP2_6=P0.18, EXP2_8=<RST>, EXP2_10=<NC>
=======================
Extruder max_extrude_ratio=0.266081
Starting serial connect
Timeout on serial connect
Wait for identify_response
Traceback (most recent call last):
  File "/home/pi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/pi/klipper/klippy/serialhdl.py", line 186, in send_with_response
    return src.get_response(cmd, self.default_cmd_queue)
  File "/home/pi/klipper/klippy/serialhdl.py", line 242, in get_response
    self.serial.raw_send_wait_ack(cmd, minclock, minclock, cmd_queue)
  File "/home/pi/klipper/klippy/serialhdl.py", line 178, in raw_send_wait_ack
    raise error("Serial connection closed")
...
more of this message
...
error: Serial connection closed
Timeout on serial connect
Wait for identify_response
Traceback (most recent call last):
  File "/home/pi/klipper/klippy/serialhdl.py", line 68, in _get_identify_data
    params = self.send_with_response(msg, 'identify_response')
  File "/home/pi/klipper/klippy/serialhdl.py", line 186, in send_with_response
    return src.get_response(cmd, self.default_cmd_queue)
  File "/home/pi/klipper/klippy/serialhdl.py", line 242, in get_response
    self.serial.raw_send_wait_ack(cmd, minclock, minclock, cmd_queue)
  File "/home/pi/klipper/klippy/serialhdl.py", line 178, in raw_send_wait_ack
    raise error("Serial connection closed")
error: Serial connection closed
Timeout on serial connect
klipper-gitissuebot commented 4 years ago

Hi @kondas,

It did not look like there was a Klipper log file attached to this ticket. The log file has been engineered to answer common questions the Klipper developers have about the software and its environment (software version, hardware type, configuration, event timing, and hundreds of other questions).

Unfortunately, too many people have opened tickets without providing the log. That consumes developer time; time that would be better spent enhancing the software. If this ticket references an event that has occurred while running the software then the Klipper log must be attached to this ticket. Otherwise, this ticket will be automatically closed in a few days.

For information on obtaining the Klipper log file see: https://github.com/KevinOConnor/klipper/blob/master/docs/Contact.md

The log can still be attached to this ticket - just add a comment and attach the log to that comment.

Best regards, ~ Your friendly GitIssueBot

PS: I'm just an automated script, not a human being.

kondas commented 4 years ago

klipper.log

BlackStump commented 4 years ago

If you still have mention of marlin in your usb-id then you have not flashed the Klipper firmware to the skr1.4 ie from your config

[mcu] serial = /dev/serial/by-id/usb-marlinfw.org_Marlin_USB_Device_0D006023AF4A1C875D7C39AEF50020C7-if00

kondas commented 4 years ago

Hi, thanks for the comment. I also thought that, after seeing similar comments in other threads. After i build klipper.bin, i copy it to the microSD card as firmware.bin, and after the next reboot it gets renamed to firmware.cur. Since i have no explicit way to check if the firmware flash is successful, from this it looked like it is flashed correctly.

EDIT: Indeed, it is not flashed correctly, as i can see from the boot message @ serial

start
echo:PowerUp
Marlin 2.0.5

echo: Last Updated: 2020-03-16 | Author: (BIGTREETECH, SKR-V1.4)
echo:Compiled: Apr 21 2020
echo: Free Memory: 18903  PlannerBufferBytes: 1664