# Cant build new image

**URL:** <https://klipper.discourse.group/t/cant-build-new-image/17602>\
**Category:** General Discussion\
**Created:** [July 11, 2024, 4:40pm UTC](https://klipper.discourse.group/t/cant-build-new-image/17602 "2024-07-11T16:40:40Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![faxxe71](https://avatars.discourse-cdn.com/v4/letter/f/eb8c5e/32.png) [@faxxe71](https://klipper.discourse.group/u/faxxe71)\
**Post date:** [July 11, 2024, 4:40pm UTC](https://klipper.discourse.group/t/cant-build-new-image/17602/1 "2024-07-11T16:40:40Z")

</div>

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:

```auto
###### 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

---

<div class="post-metadata">

**Author:** ![mykepredko](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/mykepredko/32/2085_2.png) [@mykepredko](https://klipper.discourse.group/u/mykepredko)\
**Post date:** [July 11, 2024, 4:52pm UTC](https://klipper.discourse.group/t/cant-build-new-image/17602/2 "2024-07-11T16:52:15Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![faxxe71](https://avatars.discourse-cdn.com/v4/letter/f/eb8c5e/32.png) [@faxxe71](https://klipper.discourse.group/u/faxxe71)\
**Post date:** [July 12, 2024, 4:45am UTC](https://klipper.discourse.group/t/cant-build-new-image/17602/3 "2024-07-12T04:45:59Z")

</div>

```auto
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.

---

<div class="post-metadata">

**Author:** ![Sineos](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/sineos/32/18_2.png) [@Sineos](https://klipper.discourse.group/u/Sineos)\
**Post date:** [July 12, 2024, 5:15am UTC](https://klipper.discourse.group/t/cant-build-new-image/17602/4 "2024-07-12T05:15:55Z")

</div>

Try

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

```

---

<div class="post-metadata">

**Author:** ![faxxe71](https://avatars.discourse-cdn.com/v4/letter/f/eb8c5e/32.png) [@faxxe71](https://klipper.discourse.group/u/faxxe71)\
**Post date:** [July 12, 2024, 3:42pm UTC](https://klipper.discourse.group/t/cant-build-new-image/17602/5 "2024-07-12T15:42:04Z")

</div>

Thanks for support but the build process still cancels 😏

Is it my fault to compile the build in kiauh?

```auto
/=======================================================\
| ~~~~~~~~~~~~~~~~~[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

```

---

<div class="post-metadata">

**Author:** ![mykepredko](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/mykepredko/32/2085_2.png) [@mykepredko](https://klipper.discourse.group/u/mykepredko)\
**Post date:** [July 12, 2024, 4:01pm UTC](https://klipper.discourse.group/t/cant-build-new-image/17602/6 "2024-07-12T16:01:43Z")

</div>

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

The two lines flagged:

```auto
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:

```auto
cd ~
cd klipper
make clean
make

```

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

---

<div class="post-metadata">

**Author:** ![faxxe71](https://avatars.discourse-cdn.com/v4/letter/f/eb8c5e/32.png) [@faxxe71](https://klipper.discourse.group/u/faxxe71)\
**Post date:** [July 12, 2024, 6:28pm UTC](https://klipper.discourse.group/t/cant-build-new-image/17602/7 "2024-07-12T18:28:27Z")

</div>

```auto
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 $ 

```

---

<div class="post-metadata">

**Author:** ![mykepredko](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/mykepredko/32/2085_2.png) [@mykepredko](https://klipper.discourse.group/u/mykepredko)\
**Post date:** [July 12, 2024, 7:54pm UTC](https://klipper.discourse.group/t/cant-build-new-image/17602/8 "2024-07-12T19:54:28Z")

</div>

Same Error 😡

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

```auto
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:

 ![image](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/0/0d70ba21fb6fcf9b04800f8a2575651e7316f3e9.png)

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

Maybe your source files got corrupted somehow.

---

<div class="post-metadata">

**Author:** ![faxxe71](https://avatars.discourse-cdn.com/v4/letter/f/eb8c5e/32.png) [@faxxe71](https://klipper.discourse.group/u/faxxe71)\
**Post date:** [July 13, 2024, 3:40am UTC](https://klipper.discourse.group/t/cant-build-new-image/17602/9 "2024-07-13T03:40:29Z")

</div>

Good morning… there are some strange characters, right?

 ![Bildschirmfoto 2024-07-13 um 05.39.21](https://global.discourse-cdn.com/free1/uploads/klipper/original/2X/f/fcd306de8895cae22e9f22e897bb562b1c4109d6.jpeg)

---

<div class="post-metadata">

**Author:** ![faxxe71](https://avatars.discourse-cdn.com/v4/letter/f/eb8c5e/32.png) [@faxxe71](https://klipper.discourse.group/u/faxxe71)\
**Post date:** [July 13, 2024, 4:01am UTC](https://klipper.discourse.group/t/cant-build-new-image/17602/10 "2024-07-13T04:01:32Z")

</div>

Final update 🙂 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

---

<div class="post-metadata">

**Author:** ![mykepredko](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/mykepredko/32/2085_2.png) [@mykepredko](https://klipper.discourse.group/u/mykepredko)\
**Post date:** [July 13, 2024, 5:23am UTC](https://klipper.discourse.group/t/cant-build-new-image/17602/11 "2024-07-13T05:23:39Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![LifeOfBrian](https://yyz2.discourse-cdn.com/free1/user_avatar/klipper.discourse.group/lifeofbrian/32/2380_2.png) [@LifeOfBrian](https://klipper.discourse.group/u/LifeOfBrian)\
**Post date:** [July 13, 2024, 2:48pm UTC](https://klipper.discourse.group/t/cant-build-new-image/17602/12 "2024-07-13T14:48:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![faxxe71](https://avatars.discourse-cdn.com/v4/letter/f/eb8c5e/32.png) [@faxxe71](https://klipper.discourse.group/u/faxxe71)\
**Post date:** [July 14, 2024, 6:22am UTC](https://klipper.discourse.group/t/cant-build-new-image/17602/13 "2024-07-14T06:22:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/klipper/original/1X/64419bf2aac6639e6ef5cef200dcd456b0a01ac3.png) [@system](https://klipper.discourse.group/u/system)\
**Post date:** [August 13, 2024, 4:22pm UTC](https://klipper.discourse.group/t/cant-build-new-image/17602/14 "2024-08-13T16:22:58Z")

</div>

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