Cant build new image

I have installed Klipper on the Artillery X2 and a Raspberry Pi. It has been running very well and stable for about 12 months. I have regularly updated Klipper on the host. I have also always built a new image for the Artillery X2 and installed it on the printer. This has now worked great for several updates.

Since updating Klipper on the host to v0.12.0-261-g248d3dbf, I have not been able to build a new image for the printer. kiauh always crashes.

Message:

###### Initializing firmware build ...

###### Checking for the following dependencies:
â—Ź build-essential 
â—Ź dpkg-dev 
â—Ź make 
[âś“ OK] Dependencies already met!

###### Building firmware ...
  Creating symbolic link out/board
Loaded configuration '/home/faxxe/klipper/.config'
Configuration saved to '/home/faxxe/klipper/.config'
  Creating symbolic link out/board
  Building out/autoconf.h
  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/trsync.o
  Compiling out/src/adccmds.o
  Compiling out/src/spicmds.o
  Compiling out/src/sdiocmds.o
  Compiling out/src/i2ccmds.o
  Compiling out/src/pwmcmds.o
  Compiling out/src/buttons.o
  Compiling out/src/tmcuart.o
src/tmcuart.c:8:2: error: invalid preprocessing directive #inc
    8 | #inc|ude "board/gpio.h" // gpio_out_write*#incluDe""board/irq.h" // irq^disable
      |  ^~~
src/tmcuart.c:9:10: fatal error: board/misc.(: No such file or directory
    9 | #include "board/misc.(" // timer_read_time
      |          ^~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:65: out/src/tmcuart.o] Error 1

May i ask you whats wrong here?

Thanx,
faxxe

I believe that you make configuration file is out of date/is not compatible with the latest version of Klipper. Have you executed make menuconfig before the make recently?

If you haven’t, then I suggest that you do it again - it may be as simple as running make menuconfig and then quitting out of it and getting a message saying that the generated configuration file has been updated and prompts you to save the new version.

faxxe@swx2:~/klipper $ make menuconfig
Loaded configuration '/home/faxxe/klipper/.config'
No changes to save (for '/home/faxxe/klipper/.config')
faxxe@swx2:~/klipper $ 

Thank you…
No changes are saved with “make menuconfig” in the command line. Apparently everything is unchanged. The build of the image still aborts at the same point.

Try

cd /home/faxxe/klipper
git reset --hard origin/master
git pull
make clean
make distclean
make menuconfig

Thanks for support but the build process still cancels :smirk:

Is it my fault to compile the build in kiauh?

/=======================================================\
|     ~~~~~~~~~~~~~~~~~ [ KIAUH ] ~~~~~~~~~~~~~~~~~     |
|        Klipper Installation And Update Helper         |
|     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     |
\=======================================================/

###### Initializing firmware build ...

###### Checking for the following dependencies:
â—Ź build-essential 
â—Ź dpkg-dev 
â—Ź make 
[âś“ OK] Dependencies already met!
  Creating symbolic link out/board

###### Building firmware ...
  Creating symbolic link out/board
Loaded configuration '/home/faxxe/klipper/.config'
No changes to save (for '/home/faxxe/klipper/.config')
  Building out/autoconf.h
  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/trsync.o
  Compiling out/src/adccmds.o
  Compiling out/src/spicmds.o
  Compiling out/src/sdiocmds.o
  Compiling out/src/i2ccmds.o
  Compiling out/src/pwmcmds.o
  Compiling out/src/buttons.o
  Compiling out/src/tmcuart.o
src/tmcuart.c:8:2: error: invalid preprocessing directive #inc
    8 | #inc|ude "board/gpio.h" // gpio_out_write*#incluDe""board/irq.h" // irq^disable
      |  ^~~
src/tmcuart.c:9:10: fatal error: board/misc.(: No such file or directory
    9 | #include "board/misc.(" // timer_read_time
      |          ^~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:65: out/src/tmcuart.o] Error 1

Sorry, I should have looked more closely at the output that you posted.

The two lines flagged:

src/tmcuart.c:8:2: error: invalid preprocessing directive #inc
    8 | #inc|ude "board/gpio.h" // gpio_out_write*#incluDe""board/irq.h" // irq^disable
      |  ^~~
src/tmcuart.c:9:10: fatal error: board/misc.(: No such file or directory
    9 | #include "board/misc.(" // timer_read_time
      |          ^~~~~~~~~~~~~~

are weird and appear to have syntax errors that should never occur.

If you haven’t built it before outside of KIAUH, then in SSH do the following:

cd ~
cd klipper
make clean
make

Let’s see what you get from that. Please post the results of the make command.

faxxe@swx2:~/klipper $ cd ~
faxxe@swx2:~ $ cd klipper
faxxe@swx2:~/klipper $ make clean
faxxe@swx2:~/klipper $ make
  Creating symbolic link out/board
  Building out/autoconf.h
  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/trsync.o
  Compiling out/src/adccmds.o
  Compiling out/src/spicmds.o
  Compiling out/src/sdiocmds.o
  Compiling out/src/i2ccmds.o
  Compiling out/src/pwmcmds.o
  Compiling out/src/buttons.o
  Compiling out/src/tmcuart.o
src/tmcuart.c:8:2: error: invalid preprocessing directive #inc
    8 | #inc|ude "board/gpio.h" // gpio_out_write*#incluDe""board/irq.h" // irq^disable
      |  ^~~
src/tmcuart.c:9:10: fatal error: board/misc.(: No such file or directory
    9 | #include "board/misc.(" // timer_read_time
      |          ^~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:65: out/src/tmcuart.o] Error 1
faxxe@swx2:~/klipper $ 


Same Error :rage:

Could you SSH into your host, and put in the two commands:

cd ~/klipper/src
sudo nano tmcuart.c

Which will bring up the first failing file in the system’s nano editor.

Here’s what I get in one of my printers:

I’d be interested in what your lines 8 & 9 (which are being flagged) look like.

Maybe your source files got corrupted somehow.

Good morning… there are some strange characters, right?

Final update :slight_smile: You made my day… Thank you!!

tmcuart.c AND thermocouple.c were corrupted on my system.
I got the original from github /klipper/src…paste them and i could build & flash a new image.
This thread was also very helpful to understand the software behind klipper.
-faxxe

3 Likes

I’m happy you’re back up and running!

1 Like

But maybe you should check the SD card you worked this on, if not compiled somewhere else.
Something had caused those errors, maybe it is some flipped bits on the card or something else.

1 Like

That’s right. I should probably fit the Raspberry with a new SD card and renew the entire installation. The current 16GB card is almost full anyway.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.