compiled with latest version - effe6f6ddd5132db4ab4f88bf8616aab575e7691
Dmesg output when connecting to usb
[ 521.874046] usb 1-1.2: new full-speed USB device number 6 using dwc_otg
[ 521.974049] usb 1-1.2: device descriptor read/64, error -32
[ 522.194049] usb 1-1.2: device descriptor read/64, error -32
[ 522.414056] usb 1-1.2: new full-speed USB device number 7 using dwc_otg
[ 522.514053] usb 1-1.2: device descriptor read/64, error -32
[ 522.744162] usb 1-1.2: device descriptor read/64, error -32
[ 522.864138] usb 1-1-port2: attempt power cycle
[ 523.524074] usb 1-1.2: new full-speed USB device number 8 using dwc_otg
[ 523.964085] usb 1-1.2: device not accepting address 8, error -32
[ 524.294097] usb 1-1.5: reset high-speed USB device number 5 using dwc_otg
[ 525.174460] usb 1-1.4: USB disconnect, device number 4
[ 525.175135] ch341-uart ttyUSB0: ch341-uart converter now disconnected from ttyUSB0
[ 525.175216] ch341 1-1.4:1.0: device disconnected
With this version everything works fine - c176b66f291371e8ba1c171e56bb2a0416ccf16f
commit c176b66f291371e8ba1c171e56bb2a0416ccf16f
Author: Kevin O'Connor <[email protected]>
Date: Sun Jul 28 22:27:32 2019 -0400
stm32f4: Allow the USART serial port to be configured
Signed-off-by: Kevin O'Connor <[email protected]>
I will try to compile with newer versions than above and see when things broke, and will post here with results. As far as can tell it should be about when make menuconfig added options for different cpu types for STM32F103
Please let me know what information i can provide, since klipper logs is useless because the service is not even started.
Tested this on pi 3b+, pi4 ajnd lubuntu 18.04
Thank you
klippy.log
Fake klipper log for bot
There's been a bunch of changes to the stm32 code recently. However, the USB support on the stm32f103 was not changed. The config options have changed a bit, though, so make sure you have a clean checkout, be sure to rerun "make menuconfig", and make sure the appropriate config settings are in place (basically, select stm32f103, 28KiB bootloader, and otherwise use the defaults).
If you continue to have issues, can you attach your .config file here?
-Kevin
I believe the printer config file doesn't really matter because the USB serial connection is not detected on the OS level for the klipper software be able to use it. I have attached it here.
printer.cfg.zip
The printer is /dev/printerhill because i have a file in /etc/udev/rules.d/99-printerhill.rules with:
SUBSYSTEM=="tty", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="abcd", SYMLINK+="printerhill"
It's a testing platform for the X/Y part of Corexy and it moves and works corectly with the firmware version mentioned above.
I will re-compile from latest in about 8 hours hours. If its any help I can provide remote ssh access to a pi or laptop connected to that board and can help you debug.
I have used the 28kb bootloader and noticed the change in the menuconfig options - that prompted me to try older klipper versions because when i bought the mini boards (about one and a half months ago) i managed to get it running with the older menuconfig options.
git clone https://github.com/KevinOConnor/klipper .
make clean
git describe --tags
> v0.7.0-769-ge817b85
make menuconfig
then selected microcontroller "stmicroelectronics stm32f1/f4"
then selected processor model stm32f103
then selected booloader offset 28kib
left default 'use usb for communication (instead of serial)'
usb ids:
got this error now (this is new)
ERROR: The compiler failed to correctly compile Klipper
It will be necessary to upgrade the compiler
See: https://bugs.launchpad.net/ubuntu/+source/newlib/+bug/1767223
apt update
apt upgrade -y
...
make clean
make menuconfig
made sure all settings remained then ran make
Build Kconfig config file
Creating symbolic link out/board
Compiling out/src/sched.o
Compiling out/src/command.o
Compiling out/src/basecmd.o
Compiling out/src/debugcmds.o
Compiling out/src/initial_pins.o
Compiling out/src/gpiocmds.o
Compiling out/src/stepper.o
Compiling out/src/endstop.o
Compiling out/src/adccmds.o
Compiling out/src/spicmds.o
Compiling out/src/thermocouple.o
Compiling out/src/lcd_st7920.o
Compiling out/src/lcd_hd44780.o
Compiling out/src/buttons.o
Compiling out/src/tmcuart.o
Compiling out/src/spi_software.o
Compiling out/src/neopixel.o
Compiling out/src/stm32/main.o
Compiling out/src/stm32/watchdog.o
Compiling out/src/stm32/gpio.o
Compiling out/src/generic/crc16_ccitt.o
Compiling out/src/generic/armcm_irq.o
Compiling out/src/generic/armcm_timer.o
Compiling out/src/../lib/stm32f1/system_stm32f1xx.o
Compiling out/src/stm32/stm32f1.o
Compiling out/src/stm32/adc.o
Compiling out/src/stm32/spi.o
Compiling out/src/stm32/usbfs.o
Compiling out/src/generic/usb_cdc.o
Building out/compile_time_request.o
Version: v0.7.0-769-ge817b85-20190819_205041-octopus
Assembling out/src/../lib/stm32f1/gcc/startup_stm32f103xb.o
Preprocessing out/stm32.ld
Linking out/klipper.elf
Creating hex file out/klipper.bin
git rev-parse HEAD
> e817b85b78b1482c1269ef6549e430b918da01b5
put file on microsd card and powered on board with 12v power and no usb
then shutdown 12v power, removed microsd and check if a file BIGTREETECH.bigtreetech is there - and it was
Now ran
dmesg -c
to clean dmesg output from linux. Then plugged usb wire back into the board
[554916.514653] usb 3-3: new full-speed USB device number 26 using ohci-pci
[554916.674834] usb 3-3: device descriptor read/64, error -32
[554916.942838] usb 3-3: device descriptor read/64, error -32
[554917.234828] usb 3-3: new full-speed USB device number 27 using ohci-pci
[554917.394970] usb 3-3: device descriptor read/64, error -32
[554917.662645] usb 3-3: device descriptor read/64, error -32
[554917.770740] usb usb3-port3: attempt power cycle
[554918.270859] usb 3-3: new full-speed USB device number 28 using ohci-pci
[554918.686864] usb 3-3: device not accepting address 28, error -32
[554918.870873] usb 3-3: new full-speed USB device number 29 using ohci-pci
[554919.286867] usb 3-3: device not accepting address 29, error -32
[554919.286993] usb usb3-port3: unable to enumerate USB device
next, ran dmesg -c and powercycled the board (12v off, 10 second wait, 12v on
dmesg output:
[554999.596155] usb 3-3: new full-speed USB device number 30 using ohci-pci
[554999.756177] usb 3-3: device descriptor read/64, error -32
[555000.024176] usb 3-3: device descriptor read/64, error -32
[555000.320192] usb 3-3: new full-speed USB device number 31 using ohci-pci
[555000.480054] usb 3-3: device descriptor read/64, error -32
[555000.748170] usb 3-3: device descriptor read/64, error -32
[555000.856261] usb usb3-port3: attempt power cycle
[555001.356208] usb 3-3: new full-speed USB device number 32 using ohci-pci
[555001.772197] usb 3-3: device not accepting address 32, error -32
[555001.956199] usb 3-3: new full-speed USB device number 33 using ohci-pci
[555002.372199] usb 3-3: device not accepting address 33, error -32
[555002.372339] usb usb3-port3: unable to enumerate USB device
Next, reverted to old working firmware via sd card upload and repowered the board:
Dmesg output:
[555172.060626] usb 3-3: USB disconnect, device number 38
[555172.506799] usb 3-3: new full-speed USB device number 39 using ohci-pci
[555172.709877] usb 3-3: New USB device found, idVendor=2341, idProduct=abcd
[555172.709888] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[555172.709894] usb 3-3: Product: Klipper firmware
[555172.709901] usb 3-3: Manufacturer: Klipper
[555172.709907] usb 3-3: SerialNumber: 12345
[555172.713987] cdc_acm 3-3:1.0: ttyACM0: USB ACM device
This is on the same machine with everything the same (cable, usb port, board, etc).
@KevinOConnor please let me know what else to try.
Do you know on which revision the build menu for this processor changed? I'd like to make a build before and one after to see if that is the cause or something else.
Thank you for your time!
Do you know on which revision the build menu for this processor changed?
In ec3d865b it was possible to build both the old and the new stm32f103 code (the new code was under the stm32f4 menu option). In the following commit (8b9cc623) the old build method was removed.
-Kevin
Can you attach the ".config" file from the failed build? (It is a file produced by "make menuconfig" - it should be in ~/klipper/.config .)
-Kevin
dot.config.zip
This is config from latest
And this is from the working one - c176b66f291371e8ba1c171e56bb2a0416ccf16f
Uploaded correct file now for working revision.
working.zip
Can you retry with the latest code (commit c930fc39)?
-Kevin
In 5 minutes
git clone https://github.com/KevinOConnor/klipper.git
git rev-parse HEAD
> c930fc392b6977b17d6f7953bd738583974208c2
make clean
make menuconfig
stm31f1/f2 -> smt32f103 -> 28kib
.config contents:
#
# Automatically generated file; DO NOT EDIT.
# Klipper Firmware Configuration
#
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_STM32F0 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="stm32"
# CONFIG_MACH_atmega2560 is not set
# CONFIG_MACH_atmega1280 is not set
# CONFIG_MACH_at90usb1286 is not set
# CONFIG_MACH_at90usb646 is not set
# CONFIG_MACH_atmega32u4 is not set
# CONFIG_MACH_atmega1284p is not set
# CONFIG_MACH_atmega644p is not set
# CONFIG_MACH_atmega328p is not set
# CONFIG_MACH_atmega328 is not set
# CONFIG_MACH_atmega168 is not set
CONFIG_MCU="stm32f103xb"
CONFIG_CLOCK_FREQ=72000000
CONFIG_USBSERIAL=y
CONFIG_SERIAL_PORT=1
CONFIG_FLASH_SIZE=0x10000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_START=0x7000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F446 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
# CONFIG_HAVE_STM32_USBOTG is not set
# CONFIG_STM32_FLASH_START_2000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_CLOCK_REF_8M=y
#
# USB ids
#
CONFIG_USB_VENDOR_ID=0x2341
CONFIG_USB_DEVICE_ID=0xabcd
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
# CONFIG_HAVE_GPIO_I2C is not set
# CONFIG_HAVE_GPIO_HARD_PWM is not set
CONFIG_HAVE_GPIO_BITBANGING=y
CONFIG_INLINE_STEPPER_HACK=y
make command...
Build Kconfig config file
#
# configuration written to /opt/klipperlatest/klipper/.config
#
Creating symbolic link out/board
Compiling out/src/sched.o
Compiling out/src/command.o
Compiling out/src/basecmd.o
Compiling out/src/debugcmds.o
Compiling out/src/initial_pins.o
Compiling out/src/gpiocmds.o
Compiling out/src/stepper.o
Compiling out/src/endstop.o
Compiling out/src/adccmds.o
Compiling out/src/spicmds.o
Compiling out/src/thermocouple.o
Compiling out/src/lcd_st7920.o
Compiling out/src/lcd_hd44780.o
Compiling out/src/buttons.o
Compiling out/src/tmcuart.o
Compiling out/src/spi_software.o
Compiling out/src/neopixel.o
Compiling out/src/stm32/main.o
Compiling out/src/stm32/watchdog.o
Compiling out/src/stm32/gpio.o
Compiling out/src/generic/crc16_ccitt.o
Compiling out/src/generic/armcm_irq.o
Compiling out/src/generic/armcm_timer.o
Compiling out/src/../lib/stm32f1/system_stm32f1xx.o
Compiling out/src/stm32/stm32f1.o
Compiling out/src/stm32/adc.o
Compiling out/src/stm32/spi.o
Compiling out/src/stm32/usbfs.o
Compiling out/src/generic/usb_cdc.o
Building out/compile_time_request.o
Version: v0.7.0-773-gc930fc3-20190820_090132-octopus
Assembling out/src/../lib/stm32f1/gcc/startup_stm32f103xb.o
Preprocessing out/stm32.ld
Linking out/klipper.elf
Creating hex file out/klipper.bin
dmesg output with toggle power off to on
[597867.420322] usb 3-3: new full-speed USB device number 45 using ohci-pci
[597867.580306] usb 3-3: device descriptor read/64, error -62
[597867.848314] usb 3-3: device descriptor read/64, error -62
[597868.140354] usb 3-3: new full-speed USB device number 46 using ohci-pci
[597868.328335] usb 3-3: device descriptor read/64, error -62
[597868.596338] usb 3-3: device descriptor read/64, error -62
[597868.704411] usb usb3-port3: attempt power cycle
[597869.176339] usb 3-3: new full-speed USB device number 47 using ohci-pci
[597869.592388] usb 3-3: device not accepting address 47, error -62
[597869.748357] usb 3-3: new full-speed USB device number 48 using ohci-pci
[597870.192357] usb 3-3: device not accepting address 48, error -62
[597870.192495] usb usb3-port3: unable to enumerate USB device
[597875.312435] usb 3-3: new full-speed USB device number 49 using ohci-pci
[597875.472320] usb 3-3: device descriptor read/64, error -32
[597875.740331] usb 3-3: device descriptor read/64, error -32
[597876.004331] usb 3-3: new full-speed USB device number 50 using ohci-pci
[597876.164451] usb 3-3: device descriptor read/64, error -32
[597876.432456] usb 3-3: device descriptor read/64, error -32
[597876.540544] usb usb3-port3: attempt power cycle
[597877.040460] usb 3-3: new full-speed USB device number 51 using ohci-pci
[597877.456461] usb 3-3: device not accepting address 51, error -32
[597877.612462] usb 3-3: new full-speed USB device number 52 using ohci-pci
[597878.028482] usb 3-3: device not accepting address 52, error -32
[597878.028607] usb usb3-port3: unable to enumerate USB device
dmesg output with replugging in the usb cable
[597939.141431] usb 3-3: new full-speed USB device number 53 using ohci-pci
[597939.329416] usb 3-3: device descriptor read/64, error -32
[597939.597437] usb 3-3: device descriptor read/64, error -32
[597939.861313] usb 3-3: new full-speed USB device number 54 using ohci-pci
[597940.021454] usb 3-3: device descriptor read/64, error -32
[597940.289446] usb 3-3: device descriptor read/64, error -32
[597940.397524] usb usb3-port3: attempt power cycle
[597940.869457] usb 3-3: new full-speed USB device number 55 using ohci-pci
[597941.285449] usb 3-3: device not accepting address 55, error -32
[597941.441469] usb 3-3: new full-speed USB device number 56 using ohci-pci
[597941.873469] usb 3-3: device not accepting address 56, error -32
[597941.873605] usb usb3-port3: unable to enumerate USB device
A separate user was reporting that if they hit the reset button a couple of times, it would eventually come up. (Though that user also reports the latest version does boot on its own.) Do you eventually see a connection when clicking reset?
-Kevin
I will try that but in a couple of hours. Is the reset press required every boot? Because with older firmware it always connects to usb no matter what.
Done a ton of resets. No change. same errors ( -62 ). Tried different cables, different ports, a laptop, a desktop, a pi, a usb 1.1 hub, a usb 3.0 hub....
Alas, I'm unable to reproduce the problem, so it's difficult to track this down.
Are you able to successfully compile and run ec3d865 ? If so, can you provide the klipper log file from that run?
I put some code changes up on the work-stm32f1-20190820 branch:
cd ~/klipper ; git fetch ; git checkout origin/work-stm32f1-20190820 ; make ; ...flash...
You could try with that branch - but the changes on that branch are just wild guesses at this point.
-Kevin
trying ec3d865
configuration written to /opt/klipperlatest/klipper/.config
*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.
blue@octopus:/opt/klipperlatest/klipper$ make
Build Kconfig config file
Creating symbolic link out/board
Compiling out/src/sched.o
Compiling out/src/command.o
Compiling out/src/basecmd.o
Compiling out/src/debugcmds.o
Compiling out/src/initial_pins.o
Compiling out/src/gpiocmds.o
Compiling out/src/stepper.o
Compiling out/src/endstop.o
Compiling out/src/adccmds.o
Compiling out/src/spicmds.o
Compiling out/src/thermocouple.o
Compiling out/src/lcd_st7920.o
Compiling out/src/lcd_hd44780.o
Compiling out/src/buttons.o
Compiling out/src/tmcuart.o
Compiling out/src/spi_software.o
Compiling out/src/neopixel.o
Compiling out/src/stm32f1/main.o
Compiling out/src/stm32f1/gpio.o
Compiling out/src/stm32f1/adc.o
Compiling out/src/stm32f1/spi.o
Compiling out/src/../lib/stm32f1/hal/source/stm32f1xx_ll_adc.o
Compiling out/src/../lib/stm32f1/hal/source/stm32f1xx_ll_spi.o
Compiling out/src/../lib/stm32f1/hal/source/stm32f1xx_ll_gpio.o
Compiling out/src/../lib/stm32f1/hal/source/stm32f1xx_ll_exti.o
Compiling out/src/../lib/stm32f1/hal/source/stm32f1xx_ll_fsmc.o
Compiling out/src/../lib/stm32f1/hal/source/stm32f1xx_ll_usb.o
Compiling out/src/../lib/stm32f1/hal/source/stm32f1xx_ll_dma.o
Compiling out/src/../lib/stm32f1/hal/source/stm32f1xx_ll_rtc.o
Compiling out/src/../lib/stm32f1/hal/source/stm32f1xx_ll_pwr.o
Compiling out/src/../lib/stm32f1/hal/source/stm32f1xx_ll_utils.o
Compiling out/src/../lib/stm32f1/hal/source/stm32f1xx_ll_i2c.o
Compiling out/src/../lib/stm32f1/hal/source/stm32f1xx_ll_rcc.o
Compiling out/src/../lib/stm32f1/hal/source/stm32f1xx_ll_dac.o
Compiling out/src/../lib/stm32f1/hal/source/stm32f1xx_ll_crc.o
Compiling out/src/../lib/stm32f1/hal/source/stm32f1xx_ll_usart.o
Compiling out/src/../lib/stm32f1/hal/source/stm32f1xx_ll_sdmmc.o
Compiling out/src/../lib/stm32f1/hal/source/stm32f1xx_ll_tim.o
Compiling out/src/generic/crc16_ccitt.o
Compiling out/src/generic/armcm_irq.o
Compiling out/src/generic/armcm_timer.o
Compiling out/src/../lib/stm32f1/system_stm32f1xx.o
Compiling out/src/stm32f1/usbserial.o
Compiling out/src/generic/usb_cdc.o
Building out/compile_time_request.o
Version: v0.7.0-733-gec3d865-20190821_090759-octopus
Assembling out/src/../lib/stm32f1/gcc/startup_stm32f103xb.o
Preprocessing out/stm32f1.ld
Linking out/klipper.elf
Creating hex file out/klipper.bin
config file
#
# Automatically generated file; DO NOT EDIT.
# Klipper Firmware Configuration
#
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
# CONFIG_MACH_STM32F0 is not set
CONFIG_MACH_STM32F1=y
# CONFIG_MACH_STM32F4 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="stm32f1"
CONFIG_CLOCK_FREQ=72000000
CONFIG_USBSERIAL=y
CONFIG_FLASH_START=0x7000
CONFIG_STM32F1_SELECT=y
# CONFIG_STM_FLASH_START_2000 is not set
CONFIG_STM_FLASH_START_7000=y
# CONFIG_STM_FLASH_START_0000 is not set
#
# USB ids
#
CONFIG_USB_VENDOR_ID=0x2341
CONFIG_USB_DEVICE_ID=0xabcd
CONFIG_USB_SERIAL_NUMBER="12345"
CONFIG_HAVE_GPIO=y
CONFIG_HAVE_GPIO_ADC=y
CONFIG_HAVE_GPIO_SPI=y
# CONFIG_HAVE_GPIO_I2C is not set
# CONFIG_HAVE_GPIO_HARD_PWM is not set
CONFIG_HAVE_GPIO_BITBANGING=y
CONFIG_INLINE_STEPPER_HACK=y
This one works
[684733.100719] usb 3-3: USB disconnect, device number 94
[684748.659158] usb 3-3: new full-speed USB device number 95 using ohci-pci
[684748.819158] usb 3-3: device descriptor read/64, error -62
[684749.087165] usb 3-3: device descriptor read/64, error -62
[684749.351160] usb 3-3: new full-speed USB device number 96 using ohci-pci
[684749.510974] usb 3-3: device descriptor read/64, error -62
[684749.779156] usb 3-3: device descriptor read/64, error -62
[684749.887245] usb usb3-port3: attempt power cycle
[684750.595186] usb 3-3: new full-speed USB device number 97 using ohci-pci
[684750.649720] usb 3-3: New USB device found, idVendor=2341, idProduct=abcd
[684750.649731] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[684750.649738] usb 3-3: Product: Klipper firmware
[684750.649745] usb 3-3: Manufacturer: Klipper
[684750.649751] usb 3-3: SerialNumber: 12345
[684750.657248] cdc_acm 3-3:1.0: ttyACM1: USB ACM device
work-stm32f1-20190820 branch
Build Kconfig config file
Creating symbolic link out/board
Compiling out/src/sched.o
Compiling out/src/command.o
Compiling out/src/basecmd.o
Compiling out/src/debugcmds.o
Compiling out/src/initial_pins.o
Compiling out/src/gpiocmds.o
Compiling out/src/stepper.o
Compiling out/src/endstop.o
Compiling out/src/adccmds.o
Compiling out/src/spicmds.o
Compiling out/src/thermocouple.o
Compiling out/src/i2ccmds.o
Compiling out/src/lcd_st7920.o
Compiling out/src/lcd_hd44780.o
Compiling out/src/buttons.o
Compiling out/src/tmcuart.o
Compiling out/src/spi_software.o
Compiling out/src/neopixel.o
Compiling out/src/stm32/main.o
Compiling out/src/stm32/watchdog.o
Compiling out/src/stm32/gpio.o
Compiling out/src/generic/crc16_ccitt.o
Compiling out/src/generic/armcm_irq.o
Compiling out/src/generic/armcm_timer.o
Compiling out/src/../lib/stm32f1/system_stm32f1xx.o
Compiling out/src/stm32/stm32f1.o
Compiling out/src/stm32/adc.o
Compiling out/src/stm32/i2c.o
Compiling out/src/stm32/spi.o
Compiling out/src/stm32/usbfs.o
Compiling out/src/generic/usb_cdc.o
Building out/compile_time_request.o
Version: v0.7.0-779-gd2118c8-20190821_091559-octopus
Assembling out/src/../lib/stm32f1/gcc/startup_stm32f103xb.o
Preprocessing out/stm32.ld
Linking out/klipper.elf
Creating hex file out/klipper.bin
config:
#
# Automatically generated file; DO NOT EDIT.
# Klipper Firmware Configuration
#
# CONFIG_LOW_LEVEL_OPTIONS is not set
# CONFIG_MACH_AVR is not set
# CONFIG_MACH_ATSAM is not set
# CONFIG_MACH_ATSAMD is not set
# CONFIG_MACH_LPC176X is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_STM32F0 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="stm32"
CONFIG_MCU="stm32f103xb"
CONFIG_CLOCK_FREQ=72000000
CONFIG_USBSERIAL=y
CONFIG_SERIAL_PORT=1
CONFIG_FLASH_SIZE=0x10000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_START=0x7000
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F446 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
# CONFIG_HAVE_STM32_USBOTG is not set
# CONFIG_STM32_FLASH_START_2000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_CLOCK_REF_8M=y
#
# USB ids
#
CONFIG_USB_VENDOR_ID=0x2341
CONFIG_USB_DEVICE_ID=0xabcd
CONFIG_USB_SERIAL_NUMBER="12345"
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_INLINE_STEPPER_HACK=y
this one does not work
[685124.546825] usb 3-3: USB disconnect, device number 98
[685124.999826] usb 3-3: new full-speed USB device number 99 using ohci-pci
[685125.159921] usb 3-3: device descriptor read/64, error -32
[685125.427924] usb 3-3: device descriptor read/64, error -32
[685125.719922] usb 3-3: new full-speed USB device number 100 using ohci-pci
[685125.879932] usb 3-3: device descriptor read/64, error -32
[685126.147920] usb 3-3: device descriptor read/64, error -32
[685126.267803] usb usb3-port3: attempt power cycle
[685126.767946] usb 3-3: new full-speed USB device number 101 using ohci-pci
[685127.183945] usb 3-3: device not accepting address 101, error -32
[685127.367952] usb 3-3: new full-speed USB device number 102 using ohci-pci
[685127.783954] usb 3-3: device not accepting address 102, error -32
[685127.784081] usb usb3-port3: unable to enumerate USB device
[685165.984317] usb 3-3: new full-speed USB device number 103 using ohci-pci
[685166.148323] usb 3-3: device descriptor read/64, error -62
[685166.444449] usb 3-3: device descriptor read/64, error -62
[685166.740444] usb 3-3: new full-speed USB device number 104 using ohci-pci
[685166.900456] usb 3-3: device descriptor read/64, error -62
[685167.168436] usb 3-3: device descriptor read/64, error -62
[685167.276514] usb usb3-port3: attempt power cycle
[685168.080447] usb 3-3: new full-speed USB device number 105 using ohci-pci
[685168.496457] usb 3-3: device not accepting address 105, error -32
[685168.680456] usb 3-3: new full-speed USB device number 106 using ohci-pci
[685169.096466] usb 3-3: device not accepting address 106, error -32
[685169.096552] usb usb3-port3: unable to enumerate USB device
[685177.128383] usb 3-3: new full-speed USB device number 107 using ohci-pci
[685177.288391] usb 3-3: device descriptor read/64, error -32
[685177.556586] usb 3-3: device descriptor read/64, error -32
[685177.820588] usb 3-3: new full-speed USB device number 108 using ohci-pci
[685177.980590] usb 3-3: device descriptor read/64, error -32
[685178.248590] usb 3-3: device descriptor read/64, error -32
[685178.356557] usb usb3-port3: attempt power cycle
[685178.856601] usb 3-3: new full-speed USB device number 109 using ohci-pci
[685179.272603] usb 3-3: device not accepting address 109, error -32
[685179.456602] usb 3-3: new full-speed USB device number 110 using ohci-pci
[685179.872509] usb 3-3: device not accepting address 110, error -32
Should i try revisions after ec3d865 until i find one that does not work?
I will try building a couple more firmware versions after the one mentioned above and see what happens.
ec3d865b517affd77678e5b1a45ef4691619726d works
but the next one
8b9cc62359057a686929cc713ffe2931e2203946 does not work
@KevinOConnor can i use some other 2 pins for serial communication instead of usb port? I think that might solve things temporarily if the USB connection is the only issue.
I got some files from another user on discord that uses this fork
Git: https://github.com/BlackStump/klipper
Revision: b2eaab922621f700d52b2519284eb0299aad010e
This works on my board
compiling on a pi 3b+ and on a ubuntu 18.04 produce different files for same git revision

left is pi, right is ubuntu

Files have different size. I was expecting the same identical size for both sources
Revision 078d278611a50054a993fcff53f166e3a65c3173
can i use some other 2 pins for serial communication instead of usb port?
The mini has a "tft" header that seems to expose uart pins. So, you should be able to disable USB support in "make menuconfig" and use a regular serial port instead. If you do this, be sure the voltages match correctly.
Files have different size. I was expecting the same identical size for both sources
Different versions of gcc produce slightly different code. It's normal.
-Kevin
@KevinOConnor compiling for skr mini works only on raspberry pi or arm systems. I'll leave this ever if anyone happens to have the same issue.
I think for now we can close this ticket? Or should I leave it open due to different behaviour of firmware depending on where it was compiled?
Can you provide more details? Are you now able to boot the latest code on the mini? What OS is unable to correctly compile Klipper? Is that system able to compile an older version of Klipper?
-Kevin
This system cannot make workable firmwares:
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
On this pi builds work:
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.4 (stretch)
Release: 9.4
Codename: stretch
And yes, latest klipper can be built on the pi and it works on skr mini. I have another pi that cannot build working firmware but the os is similar and fully upgraded. I will try to make a diff between the two pi's in the next 2-3 days when I have time.
I also noticed that firmware restart doesn't work right on newer firmwares, i have to restart host
Internal error during connect: device reports readiness to read but returned no data (device disconnected or multiple access on port?)
I believe I am running in to the same issue on the skr mini e3 (same mcu as the mini). I'll check dmesg output when I get home (8 hours or so) but the symptoms are that the device is visible in /dev when it is first plugged in, but disappears as soon as klipper tries to connect, and the only way to get it to reappear is to unplug and replug the usb cable.
Steps taken to get to this point: After a fresh clone of master, I chose stm32f103 with 28kb bootloader in menuconfig, ran make and copied out/klipper.bin onto the sdcard and inserted it into the board.
I'd be happy to help in any debugging efforts with this board.
Reading about the possible differences in build environment I'll add that this is all taking place on a Pi 3B (not 3B+), I don't know if that is relevant or not.
@vladbabii which raspberry Pis did and did not work for you?
I've been doing some reading around and my issue may be unrelated to this after all.
People have been reporting similar symptoms to mine (on the SKR Mini E3) with Marlin and it turns out the MCU needs to set PC13 to output low at startup to properly initialise the USB connection, this is mentioned
in this comment on the the SKR mini e3 github, and fixed in PR #14679 in marlin.
I believe I should be able to set this correctly in menuconfig, so I'll test and report back in a few hours.
UPDATE: The issue I saw was indeed caused by not setting PC13 low at MCU startup. I apologise for polluting this issue with unrelated comments. I'll look at creating a PR to document this issue for the SKR Mini E3.
@AshIzat how did you set pin PC13 low? I will try on my mini
@KevinOConnor can you point me in the right direction to set PC13 low on startup in firmware?
@vladbabii as far as I can tell, the SKR Mini 1.1 doesn't have the same issue as the Mini E3, on the Mini E3 the D+ line of the USB connection has it's pull-up resistor connected via a p-channel mosfet controlled by PC13. I don't have an SKR Mini 1.1 so I can't be sure, but looking at pictures it seems to have it's pull-up connected directly (I don't see anything that looks like a mosfet near the USB connection). Even if it does have the same problem, it wouldn't be PC13 that needs setting low, as that appears to be used in the expansion header.
Sorry for causing confusion, I thought my problem was the same as in this issue (similar symptoms, same mcu), but it turns out it wasn't, once I set PC13 low on startup USB worked fine for me on the Mini E3.
For the reference of anyone reading this who does have the Mini E3, when you run make menuconfig before building the firmware, you can set the initial states of pins at MCU startup, !PC13 is the value you need to bring PC13 Low at startup.
FYI, when I get a chance, I'll try building Klipper on an Ubuntu virtual machine to see why it is not compiling Klipper correctly - but it'll likely be several weeks before I get to that.
-Kevin
@KevinOConnor If it helps, I can give you ssh access to a VM with whatever ubuntu flavor you want.
I'm having the same problem here. Plugging in the device with dmesg:
[ 4188.792809] usb 6-1: new full-speed USB device number 40 using ohci-platform
[ 4188.984812] usb 6-1: device descriptor read/64, error -32
[ 4189.284819] usb 6-1: device descriptor read/64, error -32
[ 4189.580821] usb 6-1: new full-speed USB device number 41 using ohci-platform
[ 4189.772821] usb 6-1: device descriptor read/64, error -32
[ 4190.072829] usb 6-1: device descriptor read/64, error -32
[ 4190.180897] usb usb6-port1: attempt power cycle
[ 4190.684848] usb 6-1: new full-speed USB device number 42 using ohci-platform
[ 4191.100855] usb 6-1: device not accepting address 42, error -32
[ 4191.288858] usb 6-1: new full-speed USB device number 43 using ohci-platform
[ 4191.704853] usb 6-1: device not accepting address 43, error -32
[ 4191.704937] usb usb6-port1: unable to enumerate USB device
I've used the instructions from the example e3 config.
Compiled on Linux or pi?
Compiled on OrangePi Zero running Welcome to Ubuntu Bionic with Armbian Linux 4.19.57-sunxi.
Funny thing is that it worked originally, but I can't remember what I changed.
@KevinOConnor What can I do to help out?
@pusewicz if you give me your compile settings and git version i can try compiling a file on a pi and check if that works or not...
@vladbabii
#
# 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 is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_STM32F0 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="stm32"
CONFIG_MCU="stm32f103xb"
CONFIG_CLOCK_FREQ=72000000
CONFIG_USBSERIAL=y
CONFIG_SERIAL_PORT=1
CONFIG_FLASH_START=0x8007000
CONFIG_FLASH_SIZE=0x10000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F446 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
# CONFIG_HAVE_STM32_USBOTG is not set
# CONFIG_STM32_FLASH_START_2000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_STM32_CLOCK_REF_8M=y
# CONFIG_STM32_CLOCK_REF_INTERNAL is not set
CONFIG_CLOCK_REF_8M=y
#
# USB ids
#
CONFIG_USB_VENDOR_ID=0x2341
CONFIG_USB_DEVICE_ID=0xabcd
CONFIG_USB_SERIAL_NUMBER="12345"
# 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_INLINE_STEPPER_HACK=y
SHA1: 12feb6d7fbd85d34a81d23e59472e3083622a206
The initial pins configuration made no difference.
klipper.zip
@pusewicz here you go
@vladbabii Did you try it?
I have a Pi 4 and SKR Mini 1.1
My current problem is that I get no recognition whatsoever after plugging in the USB cable. Not on Klipper yet, just trying to get Octoprint connected. "lsusb" produces this, both before and after pluggin in the USB cable:
pi@octopi:~ $ lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pi@octopi:~ $ lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
@pusewicz - I built the image for you to try. I don't have anything free at the moment to use it on
@anm8tor - try the firmware I uploaded above, it should work
@vladbabii This image replaces both Klipper and Octopi on the Pi4?
That's klipper firmware for the board
I got a chance to compile Klipper on an Ubuntu 18.04 VM. However, I was unable to reproduce the problem. I compiled for stm32f103 (with an 8KiB bootloader) and the resulting binary came up fine on my "blue pill" test board.
Could you verify the problem is still present with the very latest Klipper version?
-Kevin
I have also lost the usb when updating firmware on this board. if put firmware.bin from a few weeks ago it finds the usb again but with the latest pull and compiled firmware.bin there is no serial in /dev
firmware compiled on beaglebone black debian.
[ 1.529782] usb 1-1: new full-speed USB device number 2 using musb-hdrc
[ 1.661704] usb 1-1: device descriptor read/64, error -32
[ 1.905657] usb 1-1: device descriptor read/64, error -32
[ 2.153739] usb 1-1: new full-speed USB device number 3 using musb-hdrc
[ 2.281741] usb 1-1: device descriptor read/64, error -32
[ 2.494512] [drm] Cannot find any crtc or sizes
[ 2.529765] usb 1-1: device descriptor read/64, error -32
[ 2.645844] usb usb1-port1: attempt power cycle
[ 3.089776] usb 1-1: new full-speed USB device number 4 using musb-hdrc
[ 3.633748] usb 1-1: new full-speed USB device number 5 using musb-hdrc
with old firmware
[ 1286.741568] usb 1-1: new full-speed USB device number 6 using musb-hdrc
[ 1286.890843] usb 1-1: New USB device found, idVendor=2341, idProduct=abcd
[ 1286.890863] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1286.890872] usb 1-1: Product: Klipper firmware
[ 1286.890879] usb 1-1: Manufacturer: Klipper
[ 1286.890887] usb 1-1: SerialNumber: 12345
[ 1286.956736] cdc_acm 1-1:1.0: ttyACM0: USB ACM device
[ 1286.967049] usbcore: registered new interface driver cdc_acm
[ 1286.967067] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
@vladbabii Forgive my ignorance, this is still very new to me. My understanding was that I need Octoprint/Octopi and Klipper installed together. Are you saying I can just install the Killer image?
@anm8tor
https://octoprint.org/
Octoprint is a web interface for 3d printers and not the only web interface that can be used with klipper just the web interface of choice by the dev.
Octopi is a image for the rasberrypi sbc that has octoprint already installed.
Klipper is software/firmware for 3d printer they are not the same and not dependent on each other but can be used together .
have you read the install process?
https://github.com/KevinOConnor/klipper/blob/master/docs/Installation.md
@blackstump Thanks for the response. I haven't read the entire thing, but the first line in the file is what I was referencing. I originally commented on this thread, because my Pi4 with the following Octopi image doesn't see my SKR mini at all, but sees other USB devices just fine.
https://storage.googleapis.com/octoprint/2019-06-24_2019-06-20-octopi-buster-lite-0.17.0.zip
@anm8tor
You can run
dmesg -c
to clear all message logs from pi, then plugin the usb cable then run
and you can get the logs from the pi of what the pi sees when the board gets plugged in. You can attach the log here or copy-paste it so we can see what error you get.
Also, try using the reset button on the board after flashing.
@anm8tor i will try later today the firmware image i sent you - i need to buy a new microsd card, the last one died on me and i only have 128gb ones that won't work with the skr.
Alas, I'm unable to reproduce this failure. If this is still an issue, please checkout a known good version of Klipper (git checkout <revision>), compile it, load it on the board, obtain the klipper log, grab the out/ directory (tar cfz klipper-good.tar.gz out/). Then checkout the latest version of Klipper (git checkout origin/master), compile it on identical machine and compiler, load it on the board, grab the klipper log, grab the out/ directory (tar cfz klipper-bad.tar.gz out/). Finally, attach all four files here along with the OS revision (cat /etc/os-release) and compiler version (arm-none-eabi-gcc --version ; arm-none-eabi-ld --version).
-Kevin
@anm8tor
You can rundmesg -cto clear all message logs from pi, then plugin the usb cable then run
and you can get the logs from the pi of what the pi sees when the board gets plugged in. You can attach the log here or copy-paste it so we can see what error you get.
Also, try using the reset button on the board after flashing.
@vladbabii - this produces nothing, as the Pi "sees" no changes once I plug the usb cable in. In reference to the firmware image, does that go straight onto my board, in place of the Marlin firmware, or on the Pi? If the latter, I'm not sure it will change the fact that plugging in the cable triggers no signal
@anm8tor I had the exact problem with skr mini 1.1 - it was working fine and as soon as I updated to latest version of klipper firmware I started getting the device descriptor read/64, error -32 error. After few tries that error went away but pi stopped seeing the usb connection at all. I did manage to get klipper connected with the same board using serial pins but was unstable. I gave up and got an skr1.3 which has been working great. IMHO this has something to do with the board and not Klipper.
I compiled on a spare beaglebone black with a clean install of debian and a clean install of klipper
I compiled the skr-mini firmware and test on the board.
I reverted back to commit 7efc53ff59111061908405dae889a38cc6e60dbb
I complied the skr-mini firmware and test on the board.
I used that sdcard with the clean install on the printer that has the beaglebone black replicape skr mini attached, I did not want to strip the printer just to hook up the skr mini on the spare beaglebone black.
The klipper version will come up as dirty only because I had to use a modified klipper_pru_start.sh which I have included
klipper-pru-start.zip
klipper-good.tar.gz
klipper-bad.tar.gz
klippy_good.log
klippy_bad.log
os.txt
Just tested master on my SKR MINI E3:
[ 164.414664] usb 6-1: new full-speed USB device number 6 using ohci-platform
[ 164.606661] usb 6-1: device descriptor read/64, error -32
[ 164.906664] usb 6-1: device descriptor read/64, error -32
[ 165.202655] usb 6-1: new full-speed USB device number 7 using ohci-platform
[ 165.394656] usb 6-1: device descriptor read/64, error -32
[ 165.694660] usb 6-1: device descriptor read/64, error -32
[ 165.802707] usb usb6-port1: attempt power cycle
[ 166.306658] usb 6-1: new full-speed USB device number 8 using ohci-platform
[ 166.722655] usb 6-1: device not accepting address 8, error -32
[ 166.910659] usb 6-1: new full-speed USB device number 9 using ohci-platform
[ 167.326648] usb 6-1: device not accepting address 9, error -32
[ 167.326721] usb usb6-port1: unable to enumerate USB device
.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 is not set
CONFIG_MACH_STM32=y
# CONFIG_MACH_STM32F0 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="stm32"
CONFIG_MCU="stm32f103xb"
CONFIG_CLOCK_FREQ=72000000
CONFIG_USBSERIAL=y
CONFIG_SERIAL_PORT=1
CONFIG_FLASH_START=0x8007000
CONFIG_FLASH_SIZE=0x10000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x5000
CONFIG_STACK_SIZE=512
CONFIG_STM32_SELECT=y
CONFIG_MACH_STM32F103=y
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F446 is not set
CONFIG_MACH_STM32F1=y
CONFIG_HAVE_STM32_USBFS=y
# CONFIG_HAVE_STM32_USBOTG is not set
# CONFIG_STM32_FLASH_START_2000 is not set
CONFIG_STM32_FLASH_START_7000=y
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_STM32_CLOCK_REF_8M=y
# CONFIG_STM32_CLOCK_REF_INTERNAL is not set
CONFIG_CLOCK_REF_8M=y
#
# USB ids
#
CONFIG_USB_VENDOR_ID=0x2341
CONFIG_USB_DEVICE_ID=0xabcd
CONFIG_USB_SERIAL_NUMBER="12345"
# CONFIG_CUSTOM_STEP_DELAY is not set
CONFIG_INITIAL_PINS="!PC13"
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_INLINE_STEPPER_HACK=y
@vladbabii Tried your built firmware, same problem.
@BlackStump - if you use a firmware compiled on an RPi (eg, klipper.bin.gz - stm32f103, revision 49779f13, 28KiB ), does it boot?
-Kevin
@KevinOConnor
no same result as compiled on the beaglebone black
Unable to open port: [Errno 2] could not open port /dev/serial/by-path/platform-musb-hdrc.1-usb-0:1:1.0: [Errno 2] No such file or directory: '/dev/serial/by-path/platform-musb-hdrc.1-usb-0:1:1.0'
@BlackStump - Okay, thanks. It would seem there is some confusion on the past errors, and/or this is a different error from the previous issues. It doesn't seem you setup is impacted by compiler version. Do you know what the last working version was? Does c930fc3 work for you (eg,
klipper-c930fc39.bin.gz - stm32f103, revision c930fc39, 28KiB)?
@vladbabii - You said you were able to get a recent version of Klipper working on the mini when compiling on an RPi - can you provide a klipper log file from that installation?
-Kevin
@KevinOConnor
c930fc39 also fails using the bin that you supplied
@KevinOConnor i had bad luck with micro sd cards - need to buy again one. I don't have access to printer but the klipper log file says
Git version: 'v0.7.0-418-gd7e1061'
I will post more information in about 6-7 hours.
@KevinOConnor
the last revision that is working so far is 9335cc compiled on the BBB
I have not tested anything between that and the latest that fails
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 9.4 (stretch)
Release: 9.4
Codename: stretch
git clone https://github.com/KevinOConnor/klipper .
make clean
git describe --tags
> v0.7.0-833-g49779f1
make menuconfig
build logs
then selected microcontroller "stmicroelectronics stm32f1/f4"
then selected processor model stm32f103
then selected booloader offset 28kib
left default 'use usb for communication (instead of serial)'
usb ids:
Build Kconfig config file
#
# configuration written to /opt/klatest/klipper/.config
#
Creating symbolic link out/board
Compiling out/src/sched.o
Compiling out/src/command.o
Compiling out/src/basecmd.o
Compiling out/src/debugcmds.o
Compiling out/src/initial_pins.o
Compiling out/src/gpiocmds.o
Compiling out/src/stepper.o
Compiling out/src/endstop.o
Compiling out/src/adccmds.o
Compiling out/src/spicmds.o
Compiling out/src/thermocouple.o
Compiling out/src/i2ccmds.o
Compiling out/src/lcd_st7920.o
Compiling out/src/lcd_hd44780.o
Compiling out/src/buttons.o
Compiling out/src/tmcuart.o
Compiling out/src/spi_software.o
Compiling out/src/neopixel.o
Compiling out/src/stm32/main.o
Compiling out/src/stm32/watchdog.o
Compiling out/src/stm32/gpio.o
Compiling out/src/generic/armcm_boot.o
Compiling out/src/generic/crc16_ccitt.o
Compiling out/src/generic/armcm_irq.o
Compiling out/src/generic/armcm_timer.o
Compiling out/src/../lib/stm32f1/system_stm32f1xx.o
Compiling out/src/stm32/stm32f1.o
Compiling out/src/stm32/adc.o
Compiling out/src/stm32/i2c.o
Compiling out/src/stm32/spi.o
Compiling out/src/stm32/usbfs.o
Compiling out/src/generic/usb_cdc.o
Building out/compile_time_request.o
Version: v0.7.0-833-g49779f1-20190911_221538-bennyprinter
Preprocessing out/src/generic/armcm_link.ld
Linking out/klipper.elf
Creating hex file out/klipper.bin
[87349.765946] usb 1-3.1: new full-speed USB device number 15 using ehci-pci
[87349.946071] usb 1-3.1: device descriptor read/64, error -32
[87350.234049] usb 1-3.1: device descriptor read/64, error -32
[87350.522039] usb 1-3.1: new full-speed USB device number 16 using ehci-pci
[87350.702035] usb 1-3.1: device descriptor read/64, error -32
[87350.989954] usb 1-3.1: device descriptor read/64, error -32
[87351.098267] usb 1-3-port1: attempt power cycle
[87351.801982] usb 1-3.1: new full-speed USB device number 17 using ehci-pci
[87352.218053] usb 1-3.1: device not accepting address 17, error -32
[87352.398064] usb 1-3.1: new full-speed USB device number 18 using ehci-pci
[87352.814185] usb 1-3.1: device not accepting address 18, error -32
[87352.814397] usb 1-3-port1: unable to enumerate USB device
Does not work. Firmware attached
klipper_v0.7.0-833-g49779f1-20190911_221538-bennyprinter.zip
same pi
git checkout v0.7.0-775-g078d278
git describe --tags
v0.7.0-775-g078d278
make clean
make menuconfig
make
build logs
Build Kconfig config file
Creating symbolic link out/board
Compiling out/src/sched.o
Compiling out/src/command.o
Compiling out/src/basecmd.o
Compiling out/src/debugcmds.o
Compiling out/src/initial_pins.o
Compiling out/src/gpiocmds.o
Compiling out/src/stepper.o
Compiling out/src/endstop.o
Compiling out/src/adccmds.o
Compiling out/src/spicmds.o
Compiling out/src/thermocouple.o
Compiling out/src/i2ccmds.o
Compiling out/src/lcd_st7920.o
Compiling out/src/lcd_hd44780.o
Compiling out/src/buttons.o
Compiling out/src/tmcuart.o
Compiling out/src/spi_software.o
Compiling out/src/neopixel.o
Compiling out/src/stm32/main.o
Compiling out/src/stm32/watchdog.o
Compiling out/src/stm32/gpio.o
Compiling out/src/generic/crc16_ccitt.o
Compiling out/src/generic/armcm_irq.o
Compiling out/src/generic/armcm_timer.o
Compiling out/src/../lib/stm32f1/system_stm32f1xx.o
Compiling out/src/stm32/stm32f1.o
Compiling out/src/stm32/adc.o
Compiling out/src/stm32/i2c.o
Compiling out/src/stm32/spi.o
Compiling out/src/stm32/usbfs.o
Compiling out/src/generic/usb_cdc.o
Building out/compile_time_request.o
Version: v0.7.0-775-g078d278-20190911_222911-bennyprinter
Assembling out/src/../lib/stm32f1/gcc/startup_stm32f103xb.o
Preprocessing out/stm32.ld
Linking out/klipper.elf
Creating hex file out/klipper.bin
[87861.686614] usb 1-3.1: new full-speed USB device number 19 using ehci-pci
[87861.866713] usb 1-3.1: device descriptor read/64, error -32
[87862.154634] usb 1-3.1: device descriptor read/64, error -32
[87862.442644] usb 1-3.1: new full-speed USB device number 20 using ehci-pci
[87862.622451] usb 1-3.1: device descriptor read/64, error -32
[87863.150658] usb 1-3.1: device descriptor read/64, error -71
[87863.258867] usb 1-3-port1: attempt power cycle
[87863.962671] usb 1-3.1: new full-speed USB device number 21 using ehci-pci
[87864.002201] usb 1-3.1: New USB device found, idVendor=2341, idProduct=abcd
[87864.002214] usb 1-3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[87864.002220] usb 1-3.1: Product: Klipper firmware
[87864.002226] usb 1-3.1: Manufacturer: Klipper
[87864.002231] usb 1-3.1: SerialNumber: 12345
[87864.009436] cdc_acm 1-3.1:1.0: ttyACM0: USB ACM device
Klipper connects, the error below is normal because this is a spare empty board, not the one i use normally.
Unable to read tmc uart 'stepper_x' register IFCNT
Once the underlying issue is corrected, use the "RESTART"
command to reload the config and restart the host software.
Printer is halted
Klipper state: Not ready
klipper.v0.7.0-775-g078d278.zip
Attached file with firmware.
v0.7.0-775-g078d278 on lubuntu desktop, same steps as my prior post
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
build logs
Build Kconfig config file
#
# configuration written to /opt/klatest/klipper/.config
#
Creating symbolic link out/board
Compiling out/src/sched.o
Compiling out/src/command.o
Compiling out/src/basecmd.o
Compiling out/src/debugcmds.o
Compiling out/src/initial_pins.o
Compiling out/src/gpiocmds.o
Compiling out/src/stepper.o
Compiling out/src/endstop.o
Compiling out/src/adccmds.o
Compiling out/src/spicmds.o
Compiling out/src/thermocouple.o
Compiling out/src/i2ccmds.o
Compiling out/src/lcd_st7920.o
Compiling out/src/lcd_hd44780.o
Compiling out/src/buttons.o
Compiling out/src/tmcuart.o
Compiling out/src/spi_software.o
Compiling out/src/neopixel.o
Compiling out/src/stm32/main.o
Compiling out/src/stm32/watchdog.o
Compiling out/src/stm32/gpio.o
Compiling out/src/generic/crc16_ccitt.o
Compiling out/src/generic/armcm_irq.o
Compiling out/src/generic/armcm_timer.o
Compiling out/src/../lib/stm32f1/system_stm32f1xx.o
Compiling out/src/stm32/stm32f1.o
Compiling out/src/stm32/adc.o
Compiling out/src/stm32/i2c.o
Compiling out/src/stm32/spi.o
Compiling out/src/stm32/usbfs.o
Compiling out/src/generic/usb_cdc.o
Building out/compile_time_request.o
Version: v0.7.0-775-g078d278-20190911_224019-octopus
Assembling out/src/../lib/stm32f1/gcc/startup_stm32f103xb.o
Preprocessing out/stm32.ld
Linking out/klipper.elf
Creating hex file out/klipper.bin
[88537.910667] usb 1-3.1: new full-speed USB device number 22 using ehci-pci
[88538.125638] usb 1-3.1: New USB device found, idVendor=2341, idProduct=abcd
[88538.125651] usb 1-3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[88538.125657] usb 1-3.1: Product: Klipper firmware
[88538.125663] usb 1-3.1: Manufacturer: Klipper
[88538.125669] usb 1-3.1: SerialNumber: 12345
[88538.127706] cdc_acm 1-3.1:1.0: ttyACM1: USB ACM device
Surprinzingly, clean dmesg with no errors compared to one compiled on pi 3b. Klipper connects with the proper error (as i mentioned above, it's a test board with no steppers).
Unable to read tmc uart 'stepper_x' register IFCNT
Once the underlying issue is corrected, use the "RESTART"
command to reload the config and restart the host software.
Printer is halted
Klipper state: Not ready
@anm8tor & @basriram - You can find above 2 working firmwares for the skr mini 1.1
@KevinOConnor let me know if you need something else for me to run.
@vladbabii i'll give it a try, but doing more research and knowing that I am running 2208 drivers, I'm not sure it will be worth it. I can at least test USB communication
v0.7.0-833-g49779f1 (latest) on lubuntu desktop, same steps as my prior posts
Distributor ID: Ubuntu
Description: Ubuntu 18.04.3 LTS
Release: 18.04
Codename: bionic
build logs
Build Kconfig config file
Creating symbolic link out/board
Compiling out/src/sched.o
Compiling out/src/command.o
Compiling out/src/basecmd.o
Compiling out/src/debugcmds.o
Compiling out/src/initial_pins.o
Compiling out/src/gpiocmds.o
Compiling out/src/stepper.o
Compiling out/src/endstop.o
Compiling out/src/adccmds.o
Compiling out/src/spicmds.o
Compiling out/src/thermocouple.o
Compiling out/src/i2ccmds.o
Compiling out/src/lcd_st7920.o
Compiling out/src/lcd_hd44780.o
Compiling out/src/buttons.o
Compiling out/src/tmcuart.o
Compiling out/src/spi_software.o
Compiling out/src/neopixel.o
Compiling out/src/stm32/main.o
Compiling out/src/stm32/watchdog.o
Compiling out/src/stm32/gpio.o
Compiling out/src/generic/armcm_boot.o
Compiling out/src/generic/crc16_ccitt.o
Compiling out/src/generic/armcm_irq.o
Compiling out/src/generic/armcm_timer.o
Compiling out/src/../lib/stm32f1/system_stm32f1xx.o
Compiling out/src/stm32/stm32f1.o
Compiling out/src/stm32/adc.o
Compiling out/src/stm32/i2c.o
Compiling out/src/stm32/spi.o
Compiling out/src/stm32/usbfs.o
Compiling out/src/generic/usb_cdc.o
Building out/compile_time_request.o
Version: v0.7.0-833-g49779f1-20190911_225214-octopus
Preprocessing out/src/generic/armcm_link.ld
Linking out/klipper.elf
Creating hex file out/klipper.bin
[89586.413396] usb 1-3.1: new full-speed USB device number 29 using ehci-pci
[89586.597431] usb 1-3.1: device descriptor read/64, error -32
[89586.885308] usb 1-3.1: device descriptor read/64, error -32
[89587.173414] usb 1-3.1: new full-speed USB device number 30 using ehci-pci
[89587.353512] usb 1-3.1: device descriptor read/64, error -32
[89587.641402] usb 1-3.1: device descriptor read/64, error -32
klipper.v0.7.0-833-g49779f1.lubuntu.zip
Doesn't work.
@vladbabii i'll give it a try, but doing more research and knowing that I am running 2208 drivers, I'm not sure it will be worth it. I can at least test USB communication
@anm8tor TMC 2208 and 2209 work on skr mini firmware builds above, with UART.
@KevinOConnor
I have narrowed it down to
https://github.com/KevinOConnor/klipper/commit/c380d4639b61042e53e1c2b98c3f45105f55bbf0
works
https://github.com/KevinOConnor/klipper/commit/7031202e7c2c7f96eb351399f629d718e7733388
fails to find the usb
Well, that's certainly a surprising result. Can you attach the Klipper log files from the successful boots?
My suspicion is that the bootloader on the skr mini is flaky and is not actually deploying the binaries correctly. (Either randomly not deploying, or perhaps it is scanning for something in the binary that is randomly passing.)
Probably the best way to determine if that is the case is to hook up the SWD lines to a Raspberry Pi and run OpenOCD to debug the situation.
-Kevin
@KevinOConnor
c380d46.log
7031202.log
@KevinOConnor
I used commit https://github.com/KevinOConnor/klipper/commit/49779f13a23be766b3a131a285f7fb5447488c74
which failed to boot the skr mini but reverted
src/stm32/gpio.h
src/stm32/spi.c
to before
https://github.com/KevinOConnor/klipper/commit/7031202e7c2c7f96eb351399f629d718e7733388
and it boots
klippy.log
@BlackStump - FYI, none of the spi.c code is run until after host and mcu have successfully connected. This looks to me like it just happened to result in a slightly different code layout which the bootloader accepted.
-Kevin
@KevinOConnor
Is it possible to replace the flaky bootloader with a sane one? or what is the solution going forward?
It is possible to replace the bootloader via the serial port - there's some details in docs/Bootloaders.md. That's not a particularly good option for most users, so finding the root cause on the skr mini is probably a good thing - I suspect that will require someone with the device to debug it via a hardware debugger (eg, OpenOCD).
-Kevin
FYI, I was able to boot the klipper-bad.tar.gz image from https://github.com/KevinOConnor/klipper/issues/1884#issuecomment-529770691 on my stm32f103 test board. So, this definitely seems like the bootloader isn't writing the firmware correctly.
If someone has an image that doesn't boot, they could try reading out the rom via the serial port (wire up the serial port to an rpi, set the boot0 pin high, reboot, run stm32flash -r image.bin /dev/ttyAMA0). Then see how the image that actually got written differs from the requested image.
Another simple test would be to see if padding helps. Run head -c 4096 /dev/zero > pad4k.bin ; cat out/klipper.bin pad4k.bin > firmware.bin and then flash resulting firmware.bin file.
-Kevin
@KevinOConnor
I just tried the padding option, alas still does not boot .
Can someone tell me which pins are the serial ones for skr mini? Are they 5v or 3.3v? I want to try to do some tests myself.
The serial pins are the RX0/TX0 on the "TFT" header. The SWD pins are the SWDIO/SWCLK pins on the "ICSP" header. Those pins (but not all the pins on the given header) should be 3.3V.
-Kevin
@KevinOConnor would i be able to upload a new firmware via the serial pins if i use a serial cable? Or do i need to also change bootloader?
I'm having the same issue on a SKR Mini E3 DIP. Like BlackStump I was able to bisect the issue down to commit 7031202.
Reverting that commit makes the USB connection work. I was trying to nail down the cause in the commit and commented out the entries in the spi_bus array in src/stm32/spi.c, so the array is empty. This makes the USB connection work also.
I was wondering whether the array entries being present somehow mess with the memory layout and wanted to keep them around without being used, but I think then the array and its entries got optimized out of the image.
I also tried removing the static modifier from the array to get it in a different linker section and make it end up at a different address, but that also led to an unusable image. Not sure if that would even cause it to end up in a different linker section, but I think that makes my memory layout hypothesis less likely.
@vladbabii: You should be able to write to the flash over serial. stm32flash -w klipper.bin -S 0x8007000
I'm not 100% sure about the address though. I can't use stm32flash currently, otherwise I'd try myself.
Make sure you do a full dump of the flash before, so you can restore your bootloader in case you accidentally overwrite it.
I can't use stm32flash currently, otherwise I'd try myself.
FYI, if wiring the stm32 chip to a Raspberry Pi, be sure to read the notes at: https://www.klipper3d.org/Bootloaders.html#stm32f103-micro-controllers-blue-pill-devices
-Kevin
resetting without sd card and with sd card with firmware on it - output on serial port
Please Checking!
sd Init card error!
Please Checking!
sd Init card error!
Please Checking!
sd Init card error!
Please Checking!
sd Init card error!
Please Checking!
res=3
SD ⸮⸮⸮⸮⸮⸮ʧ⸮ܣ⸮⸮⸮⸮⸮
Firmware Update Fail⸮⸮⸮⸮⸮⸮
F_open: fr = 3 > FR_NOT_READY
-----------------O K--------------------
SD ⸮⸮⸮⸮⸮سɹ⸮⸮⸮⸮⸮⸮⸮
Total Size: 14901 MB
Free Size: 14900 MB
⸮⸮⸮⸮⸮⸮BootLoader
⸮⸮⸮ļ⸮⸮ɹ⸮
⸮⸮⸮⸮⸮ļ⸮⸮⸮С⸮⸮ 16764 Byte
bw= 2048
⸮⸮⸮⸮д⸮⸮...
bw= 2048
⸮⸮⸮⸮д⸮⸮...
bw= 2048
⸮⸮⸮⸮д⸮⸮...
bw= 2048
⸮⸮⸮⸮д⸮⸮...
bw= 2048
⸮⸮⸮⸮д⸮⸮...
bw= 2048
⸮⸮⸮⸮д⸮⸮...
bw= 2048
⸮⸮⸮⸮д⸮⸮...
bw= 2048
⸮⸮⸮⸮д⸮⸮...
bw= 380
дflash⸮⸮⸮
Flash Updata Finsh !!!
⸮⸮Ҫ⸮⸮⸮⸮⸮⸮byby !!!
-----------------O K--------------------
D ⸮⸮⸮⸮⸮سɹ⸮⸮⸮⸮⸮⸮⸮
Total Size: 14901 MB
Free Size: 14900 MB
⸮⸮⸮⸮⸮⸮BootLoader
F_open: fr = 4 > FR_NO_FILE
Firmware has been updated! or File no existence! Please check file in SD Card!
I'm using a serial cable with 3.3 pins / 5v tollerant. I power the board via usb and user serial cable to with /dev/ttyUSB0 connected to RX/TX pins
stm32flash -r image.bin /dev/ttyUSB0
stm32flash 0.5
http://stm32flash.sourceforge.net/
Interface serial_posix: 57600 8E1
Failed to init device.
This is my first time working with a stm32 device so if you can point me in the right direction i would be grateful. Thank you
In order to enter the bootloader it is necessary to pull the BOOT0 pin high. Alas, it looks like that board has the BOOT0 pin permanently tied low. Simplest solution is probably to wire up openocd on an rpi and use that mechanism to debug (as described at https://www.klipper3d.org/Bootloaders.html#running-openocd-on-the-raspberry-pi ).
Separately, was your firmware.bin file exactly 16764 bytes and was this a failure binary?
-Kevin
What was the verdict on this issue? I wanted to add that I'm experiencing the same symptoms as @vladbabii, and that reverting to commit c380d463 worked.
More details:
I replaced my Ender 3 board yesterday with an SKR Mini E3 DIP, which has the STM32F103 RET6 chip on it. I did a git pull (which brought my repo up to 9fcd3e7), and did a make menuconfig, my selections:
[*] Enable extra low-level configuration options
Micro-controller Architecture (STMicroelectronics STM32F1/F4) --->
Processor model (STM32F103) --->
Bootloader offset (28KiB bootloader) --->
Clock Reference (8Mhz crystal) --->
[*] Use USB for communication (instead of serial)
USB ids --->
(0x2341) USB vendor ID
(0xabcd) USB device ID
(12345) USB serial number
[ ] Specify a custom step pulse duration
(!PC13) GPIO pins to set at micro-controller startup
I then built it and copied to the SD card as firmware.bin. I powered up the printer, and this is what dmesg said
[331892.854343] usb 1-1.3: USB disconnect, device number 20
[331932.569391] usb 1-1.3: new full-speed USB device number 21 using dwc_otg
[331932.669376] usb 1-1.3: device descriptor read/64, error -32
[331932.889393] usb 1-1.3: device descriptor read/64, error -32
[331933.109363] usb 1-1.3: new full-speed USB device number 22 using dwc_otg
[331933.209370] usb 1-1.3: device descriptor read/64, error -32
[331933.429366] usb 1-1.3: device descriptor read/64, error -32
[331933.549502] usb 1-1-port3: attempt power cycle
[331934.209356] usb 1-1.3: new full-speed USB device number 23 using dwc_otg
[331934.649356] usb 1-1.3: device not accepting address 23, error -32
[331934.749370] usb 1-1.3: new full-speed USB device number 24 using dwc_otg
[331935.189353] usb 1-1.3: device not accepting address 24, error -32
[331935.189493] usb 1-1-port3: unable to enumerate USB device
After finding this github issue, I confirmed that these two work:
c176b66
c380d46
And dmesg looks much happier.
[332554.655152] usb 1-1.3: new full-speed USB device number 27 using dwc_otg
[332554.789574] usb 1-1.3: New USB device found, idVendor=2341, idProduct=abcd
[332554.789591] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[332554.789600] usb 1-1.3: Product: Klipper firmware
[332554.789608] usb 1-1.3: Manufacturer: Klipper
[332554.789616] usb 1-1.3: SerialNumber: 12345
[332554.858160] cdc_acm 1-1.3:1.0: ttyACM0: USB ACM device
[332554.859711] usbcore: registered new interface driver cdc_acm
[332554.859722] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
I'm willing to help test if you guys need an additional tester with an stm32 board.
Do I understand correctly that the klipper does not work on skr dip? For two days I can’t connect the board. One of the problems, I can not figure out the pins (
If anyone succeeds, please share the configuration file
One of the problems, I can not figure out the pins
@qldestlp which pins are you not able to figure out?
I've attached my config here. The setup is probably different than yours, this is the E3 Mini DIP with 4 TMC2208 drivers in UART mode (single wire mode), and a BLtouch.
My understanding is this issue is stalled until a developer can attach a hardware debugger (eg, openocd) to a board to diagnose what the underlying issue is.
If someone wants to install OpenOCD (see docs/Bootloader.md) on a Raspberry Pi, route the corresponding SWDIO/SWCLK/RESET/GND wires to the board and then give me ssh access to that Raspberry Pi, then I can try to take a quick look. I can't make any guarantees though.
-Kevin
@KevinOConnor i can setup a pi with openocd
Regards
@vladbabii it would be great if you could do that on the Pi4, that's my exact set up :) still can't get the 4 to recognize USB connection to the Mini
is pi4 ok? i have a free one right now
Should be fine.
do i need to attach a logic level converter between pi and skr mini 1.1 or are all pins 3.3v ?
The SKR mini schematic indicates those pins are 3.3v, so I would not wire up a logic level converter. Be sure to not wire the pins described as 5V on either the ICSP or the TFT header.
do you also want a relay on a pi gpio board for reseting the skr mini board if needed ?
No. With the RST pin properly wired it is possible to perform resets via OpenOCD.
If you're proving ssh access, please send me an email ([email protected]).
-Kevin
@KevinOConnor sent you an email
One of the problems, I can not figure out the pins
@qldestlp which pins are you not able to figure out?
I've attached my config here. The setup is probably different than yours, this is the E3 Mini DIP with 4 TMC2208 drivers in UART mode (single wire mode), and a BLtouch.
I had a problem with uart and tx pins. In the end, I left only uart. I tried your config. But the miracle did not happen. I can’t imagine where I was wrong.
@KevinOConnor @vladbabii Did you guys manage to get any debugging done for this issue?
@KevinOConnor @pusewicz
I'm tryng to figure out the skr mini 1.1 pins and openocd config file - openocd starts then shuts down right now
Do i need to connect sck/sdo pins on the icsp header ? Or the ones rx/tx next to board corner ? The reset pin i asume is the RST in the corner, in the row with +5v,gnd,tx,rx,rst
I also have this cable, could i use this instead of direct wiring? - https://www.adafruit.com/product/954
OpenOCD config - not sure what i should put here
# Uses RPi pins: GPIO25 for SWDCLK, GPIO24 for SWDIO, GPIO18 for nRST
source [find interface/raspberrypi2-native.cfg]
bcm2835gpio_swd_nums 25 24
bcm2835gpio_srst_num 18
transport select swd
# Set the chip (at91samd51j19 in this example)
#set CHIPNAME at91samd51j19
#source [find target/atsame5x.cfg]
set CHIPNAME stm32f1x
source [find target/stm32f1x.cfg]
# Set the adapter speed
adapter_khz 40
adapter_nsrst_delay 100
adapter_nsrst_assert_width 100
init
targets
reset halt
@KevinOConnor helped me, below is the openocd config that works. The bcm2835gpio_.. lines were needed for pi 4
source [find interface/raspberrypi2-native.cfg]
bcm2835gpio_swd_nums 24 25
bcm2835gpio_srst_num 18
transport select swd
bcm2835gpio_peripheral_base 0xFE000000
bcm2835gpio_speed_coeffs 236181 60
# Set the chip (at91samd51j19 in this example)
#set CHIPNAME at91samd51j19
#source [find target/atsame5x.cfg]
#set CHIPNAME stm32f1x
source [find target/stm32f1x.cfg]
# Set the adapter speed
adapter_khz 40
adapter_nsrst_delay 100
adapter_nsrst_assert_width 100
init
targets
reset halt
I apologize if this is a dumb question but is this issue with the SKR mini 1.1 limited to attempts to flash the firmware from the sdcard, or does it affect directly flashing over USB as well? I recently installed an SKR mini 1.1 as a secondary MCU and got it up and running using the "known good" build linked in this thread. But now that the firmware is installed, I'm wondering if I can direct-flash update to a more recent build. Or will that reintroduce the USB connection errors?
@theophile I only managed to flash it via SD card. Haven't looked into how to upload via usb yet but might need a different bootloader
Any new findings to this Issue?
Kevin debugged for a while on my pi4 and then we had some issues. I figured out you need a usb 2 hub on a pi4 to get reliable usb connection between a mini and pi4. The test platform is still up and Kevin said he will be also ordering a mini to test things on.
I am trying to figure out now how to replace the bootloader (new to openocd and these tools) and try to see if that makes a difference.
I will post here if I have anything new.
@vladbabii thanks very mucht for your feedback.
What i not understand is why some commits are working und some not, and ..... marlin do not have this issue with the SKR minis (mini, E3, E3 DIP) or i am not able to find that issue.
I'm looking forward that you specialists are doing the thing. Thanks for your hard work .....
One question, is every Version on the PI (the Part that ist running on the PI) working with every version that is flashed on the board
i compiled commit c380d46 and flashed it on my board successfully. Is the newest commit of the PI part working with this "serverversion"? I hope my question is clear .....
Apologies for the lack of logs/data etc, but I just wanted to say I have had similar issues, and with help from a few people managed to resolve using ec3d865.
Those with an SKR Mini (and similar) should retry with the latest code (commit 1e8582e3).
-Kevin
I can confirm that commit 1e8582e fixes the USB connection issue on an SKR Mini E3 DIP. Thanks a lot for your efforts and for fixing this.
Do you have any theory of how reverting the SPI changes from commit 7031202 seems to have worked around this issue?
I don't know if it's related or not, but when I try to update an SKR mini 1.1 using "make flash" I get this error:
Flashing out/klipper.bin to /dev/serial/by-id/usb-Klipper_Klipper_firmware_54321-if00
Entering bootloader on /dev/serial/by-id/usb-Klipper_Klipper_firmware_54321-if00
Device reconnect on /sys/devices/platform/soc/3f980000.usb/usb1/1-1/1-1.1/1-1.1.3/1-1.1.3:1.0
sudo dfu-util -p 1-1.1.3 -R -a 2 -D out/klipper.bin
dfu-util 0.9
Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/
dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
dfu-util: No DFU capable USB device available
Failed to flash to /dev/serial/by-id/usb-Klipper_Klipper_firmware_54321-if00: Error running dfu-util
If the device is already in bootloader mode it can be flashed with the
following command:
make flash FLASH_DEVICE=1eaf:0003
If attempting to flash via 3.3V serial, then use:
make serialflash FLASH_DEVICE=/dev/serial/by-id/usb-Klipper_Klipper_firmware_54321-if00
src/stm32/Makefile:50: recipe for target 'flash' failed
make: *** [flash] Error 255
@KevinOConnor Can confirm it connects on SKR MINI E3 V1:
[ 689.725461] usb 2-2.2: new full-speed USB device number 14 using uhci_hcd
[ 689.840120] usb 2-2.2: New USB device found, idVendor=2341, idProduct=abcd
[ 689.840122] usb 2-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 689.840123] usb 2-2.2: Product: Klipper firmware
[ 689.840123] usb 2-2.2: Manufacturer: Klipper
[ 689.840124] usb 2-2.2: SerialNumber: 12345
[ 689.843501] cdc_acm 2-2.2:1.0: ttyACM0: USB ACM device
@theophile Flashing through USB does not work on SKR MINI for now. Copy the klipper.bin to the MicroSD as firmware.bin and restart the board. It should auto-reflash itself.
I can confirm that commit 1e8582e fixes the USB connection issue on an SKR Mini E3 DIP, too.
Thanks a lot for your efforts and for fixing this.
@KevinOConnor i can confirm lastest commit 1e8582e works with mini 1.1
[334140.626994] usb 1-1.2.1: new full-speed USB device number 11 using xhci_hcd
[334140.727254] usb 1-1.2.1: device descriptor read/64, error -32
[334140.947245] usb 1-1.2.1: device descriptor read/64, error -32
[334141.167001] usb 1-1.2.1: new full-speed USB device number 12 using xhci_hcd
[334141.267261] usb 1-1.2.1: device descriptor read/64, error -32
[334141.487266] usb 1-1.2.1: device descriptor read/64, error -32
[334141.607129] usb 1-1.2-port1: attempt power cycle
[334142.267032] usb 1-1.2.1: new full-speed USB device number 13 using xhci_hcd
[334142.306128] usb 1-1.2.1: New USB device found, idVendor=2341, idProduct=abcd, bcdDevice= 1.00
[334142.306143] usb 1-1.2.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[334142.306156] usb 1-1.2.1: Product: Klipper firmware
[334142.306168] usb 1-1.2.1: Manufacturer: Klipper
[334142.306179] usb 1-1.2.1: SerialNumber: 12345
[334142.308957] cdc_acm 1-1.2.1:1.0: ttyACM0: USB ACM device
Testing the board now...
skr mini v1.2 board is working with latest pull from git, but using
stty -F /dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00 -hupcl before attempting any connection
Connecting to SKR E3 DIP also works with 1e8582e.
But make flash FLASH_DEVICE=/dev/serial/by-id/usb-Klipper_Klipper_firmware_12345-if00
doesn't work. Same error as https://github.com/KevinOConnor/klipper/issues/1884#issuecomment-541454044
Do you have any theory of how reverting the SPI changes from commit 7031202 seems to have worked around this issue?
No, I don't know why the old code sometimes worked. It's possible some obscure race was allowing the usb packet memory to function long enough and/or some obscure race resulted in a well timed reset after enabling the usb clock.
But make flash doesn't work.
The bootloader on the skr mini does not support writes by usb. Follow the directions at the top of config/generic-bigtreetech-skr-mini.cfg to flash.
-Kevin
@KevinOConnor would changing bootloader make the board capable of upload firmware via usb ? or maybe using openocd ?
Myself and some others have replaced the bootloader with the stm32duino bootloader which does support flashing over usb. Specifically this file was used: https://github.com/rogerclarkmelbourne/STM32duino-bootloader/raw/master/bootloader_only_binaries/generic_boot20_pb7.bin
As a general notice, replacing the bootloader is an advanced option - there is some info in docs/Bootloaders.md, but be sure you are comfortable with the operation and are confident you can restore the old bootloader before proceeding.
-Kevin
@KevinOConnor What's required hardware-wise to flash the new bootloader?
I imagine this is the approach to take? https://github.com/KevinOConnor/klipper/blob/master/docs/Bootloaders.md#stm32f103-with-stm32duino-bootloader
Anybody else willing to share the actual steps (ideally with pics if applicable?)
Once i manage to figure out all the steps I will post here unless someone beats me to it.
I'm going to close this ticket as it appears the original issue has been resolved.
-Kevin
@vladbabii, were you able to successfully flash a USB-capable bootloader to the mini 1.1? If so, could you share your steps? Thanks!
@vladbabii, just wanted to check in with you and see if you were able to flash a USB-capable bootloader to the SKR Mini v1.1? If so, what was your procedure?
Most helpful comment
What was the verdict on this issue? I wanted to add that I'm experiencing the same symptoms as @vladbabii, and that reverting to commit c380d463 worked.
More details:
I replaced my Ender 3 board yesterday with an SKR Mini E3 DIP, which has the STM32F103 RET6 chip on it. I did a git pull (which brought my repo up to 9fcd3e7), and did a make menuconfig, my selections:
I then built it and copied to the SD card as firmware.bin. I powered up the printer, and this is what dmesg said
After finding this github issue, I confirmed that these two work:
c176b66
c380d46
And dmesg looks much happier.
I'm willing to help test if you guys need an additional tester with an stm32 board.