NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.35k stars 14.31k forks source link

klipper-firmware-mcu build is broken #335176

Closed angaz closed 3 months ago

angaz commented 3 months ago

Describe the bug

Building the klipper-firmware-mcu package for ARM is broken. There appear to be missing dependencies.

Example output for an Octopus with STM32:

  1. Configure AVR MCU
  2. Build
  3. ...
    error: builder for '/nix/store/s7bwsk07zgfxzwlp5vsa785q69zb8xsm-klipper-firmware-mcu-0.12.0-unstable-2024-08-03.drv' failed with exit code 2;
       last 10 log lines:
       > /nix/store/asmz1gix53plyl7hk8i0d6kcm146pmwq-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /build/source/src/spicmds.c:104:(.text.spidev_transfer+0x38): undefined referenceto `spi_software_transfer'
       > /nix/store/asmz1gix53plyl7hk8i0d6kcm146pmwq-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: out/src/i2ccmds.o: in function `command_i2c_write':
       > /build/source/src/i2ccmds.c:61:(.text.command_i2c_write+0x28): undefined reference to `i2c_software_write'
       > /nix/store/asmz1gix53plyl7hk8i0d6kcm146pmwq-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: out/src/i2ccmds.o: in function `command_i2c_read':
       > /build/source/src/i2ccmds.c:78:(.text.command_i2c_read+0x44): undefined reference to `i2c_software_read'
       > /nix/store/asmz1gix53plyl7hk8i0d6kcm146pmwq-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: out/src/i2ccmds.o: in function `command_i2c_modify_bits':
       > /build/source/src/i2ccmds.c:111:(.text.command_i2c_modify_bits+0xac): undefined reference to `i2c_software_write'
       > /nix/store/asmz1gix53plyl7hk8i0d6kcm146pmwq-gcc-arm-embedded-13.2.rel1/bin/../lib/gcc/arm-none-eabi/13.2.1/../../../../arm-none-eabi/bin/ld: /build/source/src/i2ccmds.c:101:(.text.command_i2c_modify_bits+0xc8): undefined reference to `i2c_software_read'
       > collect2: error: ld returned 1 exit status
       > make: *** [Makefile:73: out/klipper.elf] Error 1
       For full logs, run 'nix log /nix/store/s7bwsk07zgfxzwlp5vsa785q69zb8xsm-klipper-firmware-mcu-0.12.0-unstable-2024-08-03.drv'.
    error: 1 dependencies of derivation '/nix/store/fyps054j2706vanwfm2x38n223d7k7f6-klipper-firmware-mcu-0.12.0-unstable-2024-08-03_fish-completions.drv' failed to build
    error: 1 dependencies of derivation '/nix/store/a7wlva6kwkgm363vrm1l0aahxpr4mx6m-klipper-flash-mcu.drv' failed to build
    error: 1 dependencies of derivation '/nix/store/cpcxqsakg26gj6n68icxcrw90jfw0dz3-system-path.drv' failed to build
    error: 1 dependencies of derivation '/nix/store/z5lkyq4cyhlfk4v3cr33q6ba7b0na779-nixos-system-voron2-24.11.20240814.c3aa7b8.drv' failed to build
    error: 1 dependencies of derivation '/nix/store/1lqk9nmfhws5pl80zhsr2xhzh52mrc3j-activatable-nixos-system-voron2-24.11.20240814.c3aa7b8.drv' failed to build

Notify maintainers

@vtuan10


Add a :+1: reaction to issues you find important.

vtuan10 commented 3 months ago

Can you please provide the used klipper.cfg? This seems to resemble https://github.com/NixOS/nixpkgs/issues/271063

angaz commented 3 months ago

Yeah, it is the same issue. I ran the klipper-genconf command and it gave me extra configuration lines, now it's compiling. Thanks.

@@ -28,6 +28,7 @@ CONFIG_STM32_SELECT=y
 # CONFIG_MACH_STM32F407 is not set
 # CONFIG_MACH_STM32F429 is not set
 CONFIG_MACH_STM32F446=y
+# CONFIG_MACH_STM32F765 is not set
 # CONFIG_MACH_STM32F031 is not set
 # CONFIG_MACH_STM32F042 is not set
 # CONFIG_MACH_STM32F070 is not set
@@ -37,6 +38,7 @@ CONFIG_MACH_STM32F446=y
 # CONFIG_MACH_STM32G0B0 is not set
 # CONFIG_MACH_STM32G0B1 is not set
 # 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
@@ -55,6 +57,7 @@ CONFIG_STM32_FLASH_START_8000=y
 CONFIG_STM32_CLOCK_REF_12M=y
 # 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=12000000
@@ -85,7 +88,17 @@ CONFIG_USB_SERIAL_NUMBER="12345"
 #
 # end of USB ids

-CONFIG_CANBUS_FREQUENCY=500000
+CONFIG_WANT_GPIO_BITBANGING=y
+CONFIG_WANT_DISPLAYS=y
+CONFIG_WANT_SENSORS=y
+CONFIG_WANT_LIS2DW=y
+CONFIG_WANT_LDC1612=y
+CONFIG_WANT_HX71X=y
+CONFIG_WANT_ADS1220=y
+CONFIG_WANT_SOFTWARE_I2C=y
+CONFIG_WANT_SOFTWARE_SPI=y
+CONFIG_NEED_SENSOR_BULK=y
+CONFIG_CANBUS_FREQUENCY=1000000
 CONFIG_INITIAL_PINS=""
 CONFIG_HAVE_GPIO=y
 CONFIG_HAVE_GPIO_ADC=y
@@ -93,7 +106,6 @@ CONFIG_HAVE_GPIO_SPI=y
 CONFIG_HAVE_GPIO_SDIO=y
 CONFIG_HAVE_GPIO_I2C=y
 CONFIG_HAVE_GPIO_HARD_PWM=y
-CONFIG_HAVE_GPIO_BITBANGING=y
 CONFIG_HAVE_STRICT_TIMING=y
 CONFIG_HAVE_CHIPID=y
 CONFIG_HAVE_STEPPER_BOTH_EDGE=y