Unable to compile since v0.13.0-9-g868760f5

Basic Information:

Printer Model: Anycubic Vyper (hardware swapped)
MCU / Printerboard: Manta M8P v1.1 mainboard, EBB42 toolhead
Host / SBC: SOQuartz v1.0 4GB
klippy.log: Not applicable (unable to build from source)

Describe your issue:

I last updated Klipper to 0.13.0 release (61c0c8d2ef40340781835dd53fb04cc7a454e37a) when it released, and decided to update again today. However, I can’t build from the repo starting from commit 868760f5b1013843aff7390bb94adfb4cb3fe679 through 9323a5dfe28619a53c7f350c2e894d299c342bca (latest as of writing) due to linker errors related to I2C and SPI:

  Creating symbolic link out/board
  Creating symbolic link out/board
  Building out/autoconf.h
  Compiling out/src/sched.o
  Compiling out/src/command.o
  Compiling out/src/debugcmds.o
  Compiling out/src/basecmd.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/trsync.o
  Compiling out/src/adccmds.o
  Compiling out/src/i2ccmds.o
  Compiling out/src/spi_software.o
  Compiling out/src/i2c_software.o
  Compiling out/src/thermocouple.o
  Compiling out/src/sensor_adxl345.o
  Compiling out/src/sensor_lis2dw.o
  Compiling out/src/sensor_mpu9250.o
  Compiling out/src/sensor_icm20948.o
  Compiling out/src/sensor_hx71x.o
  Compiling out/src/sensor_ads1220.o
  Compiling out/src/sensor_ldc1612.o
  Compiling out/src/sensor_angle.o
  Compiling out/src/sensor_bulk.o
  Compiling out/src/stm32/watchdog.o
  Compiling out/src/stm32/gpio.o
  Compiling out/src/stm32/clockline.o
  Compiling out/src/stm32/dfu_reboot.o
  Compiling out/src/generic/crc16_ccitt.o
  Compiling out/src/generic/armcm_boot.o
  Compiling out/src/generic/armcm_irq.o
  Compiling out/src/generic/armcm_reset.o
  Compiling out/src/generic/timer_irq.o
  Compiling out/src/stm32/stm32f0_timer.o
  Compiling out/src/stm32/stm32g0.o
  Compiling out/src/stm32/gpioperiph.o
  Compiling out/src/stm32/stm32f0_adc.o
  Compiling out/src/stm32/stm32f0_i2c.o
  Compiling out/src/stm32/usbfs.o
  Compiling out/src/generic/canserial.o
  Compiling out/src/../lib/fast-hash/fasthash.o
  Compiling out/src/stm32/fdcan.o
  Compiling out/src/stm32/chipid.o
  Compiling out/src/generic/usb_canbus.o
  Preprocessing out/src/generic/armcm_link.ld
  Building out/compile_time_request.o
Version: v0.13.0-9-g868760f5
  Linking out/klipper.elf
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans0.ltrans.o: in function `run_tasks':
/home/pleb/klipper/src/sensor_ads1220.c:84: undefined reference to `spidev_transfer'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans0.ltrans.o: in function `run_tasks':
/home/pleb/klipper/src/thermocouple.c:123: undefined reference to `spidev_transfer'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans0.ltrans.o:/home/pleb/klipper/src/thermocouple.c:130: undefined reference to `spidev_transfer'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans0.ltrans.o: in function `run_tasks':
/home/pleb/klipper/src/thermocouple.c:159: undefined reference to `spidev_transfer'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /home/pleb/klipper/src/thermocouple.c:108: undefined reference to `spidev_transfer'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans0.ltrans.o:/home/pleb/klipper/src/thermocouple.c:142: more undefined references to `spidev_transfer' follow
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans1.ltrans.o: in function `command_config_thermocouple':
/home/pleb/klipper/src/thermocouple.c:60: undefined reference to `spidev_oid_lookup'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans1.ltrans.o: in function `command_config_adxl345':
/home/pleb/klipper/src/sensor_adxl345.c:46: undefined reference to `spidev_oid_lookup'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans1.ltrans.o: in function `command_config_lis2dw':
/home/pleb/klipper/src/sensor_lis2dw.c:81: undefined reference to `spidev_oid_lookup'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans1.ltrans.o: in function `command_query_adxl345_status':
/home/pleb/klipper/src/sensor_adxl345.c:136: undefined reference to `spidev_transfer'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans1.ltrans.o: in function `command_config_spi_angle':
/home/pleb/klipper/src/sensor_angle.c:78: undefined reference to `spidev_oid_lookup'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /home/pleb/klipper/src/sensor_angle.c:79: undefined reference to `spidev_have_cs_pin'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans1.ltrans.o: in function `command_spi_angle_transfer':
/home/pleb/klipper/src/sensor_angle.c:329: undefined reference to `spidev_transfer'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /home/pleb/klipper/src/sensor_angle.c:319: undefined reference to `spidev_get_cs_pin'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /home/pleb/klipper/src/sensor_angle.c:326: undefined reference to `spidev_transfer'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans1.ltrans.o: in function `command_query_lis2dw_status':
/home/pleb/klipper/src/sensor_lis2dw.c:226: undefined reference to `spidev_transfer'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans1.ltrans.o: in function `adxl_query.lto_priv.0':
/home/pleb/klipper/src/sensor_adxl345.c:76: undefined reference to `spidev_transfer'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans1.ltrans.o: in function `lis2dw_query.lto_priv.0':
/home/pleb/klipper/src/sensor_lis2dw.c:137: undefined reference to `spidev_transfer'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /home/pleb/klipper/src/sensor_lis2dw.c:139: undefined reference to `spidev_transfer'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans1.ltrans.o:/home/pleb/klipper/src/sensor_angle.c:132: more undefined references to `spidev_transfer' follow
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans1.ltrans.o: in function `spi_angle_task.part.0':
/home/pleb/klipper/src/sensor_angle.c:259: undefined reference to `spidev_get_cs_pin'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans1.ltrans.o:/home/pleb/klipper/src/sensor_angle.c:270: undefined reference to `spidev_transfer'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans1.ltrans.o: in function `spi_angle_task.part.0':
/home/pleb/klipper/src/sensor_angle.c:211: undefined reference to `spidev_transfer'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /home/pleb/klipper/src/sensor_angle.c:167: undefined reference to `spidev_transfer'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /home/pleb/klipper/src/sensor_angle.c:181: undefined reference to `spidev_transfer'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans1.ltrans.o: in function `command_spi_set_software_bus':
/home/pleb/klipper/src/spi_software.c:26: undefined reference to `spidev_oid_lookup'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /home/pleb/klipper/src/spi_software.c:32: undefined reference to `spidev_set_software_bus'
/usr/lib/gcc/arm-none-eabi/12.2.1/../../../arm-none-eabi/bin/ld: /tmp/cc759FtS.ltrans1.ltrans.o: in function `command_config_ads1220':
/home/pleb/klipper/src/sensor_ads1220.c:108: undefined reference to `spidev_oid_lookup'
collect2: error: ld returned 1 exit status
make: *** [Makefile:74: out/klipper.elf] Error 1

.config (for Manta M8P, in this case) is as follows:

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_HC32F460 is not set
# CONFIG_MACH_RPXXXX is not set
# CONFIG_MACH_PRU is not set
# CONFIG_MACH_AR100 is not set
# CONFIG_MACH_LINUX is not set
# CONFIG_MACH_SIMU is not set
CONFIG_BOARD_DIRECTORY="stm32"
CONFIG_MCU="stm32g0b1xx"
CONFIG_CLOCK_FREQ=64000000
CONFIG_FLASH_SIZE=0x20000
CONFIG_FLASH_BOOT_ADDRESS=0x8000000
CONFIG_RAM_START=0x20000000
CONFIG_RAM_SIZE=0x24000
CONFIG_STACK_SIZE=512
CONFIG_FLASH_APPLICATION_ADDRESS=0x8002000
CONFIG_STM32_SELECT=y
# CONFIG_MACH_STM32F103 is not set
# CONFIG_MACH_STM32F207 is not set
# CONFIG_MACH_STM32F401 is not set
# CONFIG_MACH_STM32F405 is not set
# CONFIG_MACH_STM32F407 is not set
# CONFIG_MACH_STM32F429 is not set
# CONFIG_MACH_STM32F446 is not set
# CONFIG_MACH_STM32F765 is not set
# CONFIG_MACH_STM32F031 is not set
# CONFIG_MACH_STM32F042 is not set
# CONFIG_MACH_STM32F070 is not set
# CONFIG_MACH_STM32F072 is not set
# CONFIG_MACH_STM32G070 is not set
# CONFIG_MACH_STM32G071 is not set
# CONFIG_MACH_STM32G0B0 is not set
CONFIG_MACH_STM32G0B1=y
# CONFIG_MACH_STM32G431 is not set
# CONFIG_MACH_STM32G474 is not set
# CONFIG_MACH_STM32H723 is not set
# CONFIG_MACH_STM32H743 is not set
# CONFIG_MACH_STM32H750 is not set
# CONFIG_MACH_STM32L412 is not set
# CONFIG_MACH_N32G452 is not set
# CONFIG_MACH_N32G455 is not set
CONFIG_MACH_STM32G0=y
CONFIG_MACH_STM32G0Bx=y
CONFIG_HAVE_STM32_USBFS=y
CONFIG_HAVE_STM32_FDCANBUS=y
CONFIG_HAVE_STM32_USBCANBUS=y
CONFIG_STM32_DFU_ROM_ADDRESS=0x1fff0000
CONFIG_STM32_FLASH_START_2000=y
# CONFIG_STM32_FLASH_START_0000 is not set
CONFIG_STM32_CLOCK_REF_8M=y
# CONFIG_STM32_CLOCK_REF_12M is not set
# CONFIG_STM32_CLOCK_REF_16M is not set
# CONFIG_STM32_CLOCK_REF_20M is not set
# CONFIG_STM32_CLOCK_REF_24M is not set
# CONFIG_STM32_CLOCK_REF_25M is not set
# CONFIG_STM32_CLOCK_REF_INTERNAL is not set
CONFIG_CLOCK_REF_FREQ=8000000
CONFIG_STM32F0_TRIM=16
# CONFIG_STM32_USB_PA11_PA12 is not set
# CONFIG_STM32_SERIAL_USART1 is not set
# CONFIG_STM32_SERIAL_USART1_ALT_PB7_PB6 is not set
# CONFIG_STM32_SERIAL_USART2 is not set
# CONFIG_STM32_SERIAL_USART2_ALT_PD6_PD5 is not set
# CONFIG_STM32_SERIAL_USART3 is not set
# CONFIG_STM32_SERIAL_USART3_ALT_PD9_PD8 is not set
# CONFIG_STM32_SERIAL_USART5 is not set
# CONFIG_STM32_CANBUS_PA11_PA12 is not set
# CONFIG_STM32_CANBUS_PA11_PB9 is not set
# CONFIG_STM32_MMENU_CANBUS_PB8_PB9 is not set
# CONFIG_STM32_MMENU_CANBUS_PB12_PB13 is not set
# CONFIG_STM32_MMENU_CANBUS_PD0_PD1 is not set
# CONFIG_STM32_MMENU_CANBUS_PB0_PB1 is not set
# CONFIG_STM32_MMENU_CANBUS_PD12_PD13 is not set
# CONFIG_STM32_MMENU_CANBUS_PC2_PC3 is not set
CONFIG_STM32_USBCANBUS_PA11_PA12=y
# CONFIG_STM32_CMENU_CANBUS_PB8_PB9 is not set
# CONFIG_STM32_CMENU_CANBUS_PB5_PB6 is not set
# CONFIG_STM32_CMENU_CANBUS_PB12_PB13 is not set
# CONFIG_STM32_CMENU_CANBUS_PD0_PD1 is not set
# CONFIG_STM32_CMENU_CANBUS_PB0_PB1 is not set
CONFIG_STM32_CMENU_CANBUS_PD12_PD13=y
# CONFIG_STM32_CMENU_CANBUS_PC2_PC3 is not set
CONFIG_STM32_CANBUS_PD12_PD13=y
CONFIG_USBCANBUS=y
CONFIG_USB=y
CONFIG_USB_VENDOR_ID=0x1d50
CONFIG_USB_DEVICE_ID=0x614e
CONFIG_USB_SERIAL_NUMBER_CHIPID=y
CONFIG_USB_SERIAL_NUMBER="12345"

#
# USB ids
#
# end of USB ids

CONFIG_WANT_GPIO_BITBANGING=y
CONFIG_WANT_DISPLAYS=y
CONFIG_WANT_THERMOCOUPLE=y
CONFIG_WANT_ADXL345=y
CONFIG_WANT_LIS2DW=y
CONFIG_WANT_MPU9250=y
CONFIG_WANT_ICM20948=y
CONFIG_WANT_HX71X=y
CONFIG_WANT_ADS1220=y
CONFIG_WANT_LDC1612=y
CONFIG_WANT_SENSOR_ANGLE=y
CONFIG_WANT_SOFTWARE_I2C=y
CONFIG_WANT_SOFTWARE_SPI=y
CONFIG_NEED_SENSOR_BULK=y
CONFIG_CANBUS=y
CONFIG_CANBUS_FREQUENCY=1000000
CONFIG_INLINE_STEPPER_HACK=y
CONFIG_HAVE_STEPPER_OPTIMIZED_BOTH_EDGE=y
# CONFIG_WANT_STEPPER_OPTIMIZED_BOTH_EDGE 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=y
CONFIG_HAVE_STRICT_TIMING=y
CONFIG_HAVE_CHIPID=y
CONFIG_HAVE_BOOTLOADER_REQUEST=y

Is this a known issue, or is something broken with my env? I’m using stock Debian 12 on the SOQuartz to build and flash Klipper.

Could you post:

A screen shot image of make menuconfg, rather than a dump of the .config file like:

I think what I’m showing above are the parameters for the firmware image that you want to build.

Explain the procedure you followed for loading Klipper onto your SOQuartz v1.0. I believe that this is in the CM4 form factor -correct?

Have you loaded any other modules into klipper? Providing your latest klippy.log would be helpful.

I can imagine two reasons for this:

  • Corrupted make file left-overs. Correct with:
make clean
make distclean
make menuconfig
  • Modified Klipper sources that now clash with the update
1 Like

No modifications were made to the repo, this occurs with a freshly and manually cloned repo from GitHub - Klipper3d/klipper: Klipper is a 3d-printer firmware. Procedure for loading Klipper initially was KIAUH 6, but I manually redownloaded it once it broke during linking the first time. The SD card isn’t failing, the filesystem reports no issues and no read errors are reported with dd.

You are correct that it is CM4 form factor, it clips directly onto the Manta M8P.

Well, I did try your config.
And it clearly does not work.
But if I do, as mentioned above, the make menuconfig, which does, updates the config to the current state.
It works.

So, generally, your old config may not work, it is expected. It is expected that once upon a time, you have to run make menuconfig or make olddefconfig to update it.

Hope that helps.