1

I am trying to compile a dtsi file into a dtb and I'm stuck. I tried

dtc -I dts -O dtb -o name.dtb dtsiname.dtsi

but it gives me a syntax error on

#include <dt-bindings/input/input.h>

I tried changing this line to

\include\ "dt-bindings/input/input.h"

but then it gives me a file not found error for "input.h".

According to this response: https://stackoverflow.com/a/42839737/6431843

using make, instead of dtc can resolve issues like this. Unfortunately, it seems like no matter what I put after make it always tells me there is no rule to make that target. According to many other posts I have seen around I should, at the very least, be able to do make dtbs and it should work but its not.

joshua0823
  • 370
  • 1
  • 10
  • *Use make* is a correct answer. It does a bit more than simple calling `dtc`. And note, _*.dts**i**_ is not the same as _*.dts_. – 0andriy Aug 22 '19 at 19:59
  • I am trying to use make and it doesn't work. Read my whole question... – joshua0823 Aug 22 '19 at 20:13
  • I had read it and it misses the information. So, I suppose you are doing something in a wrong way, or your source tree is damaged somehow. – 0andriy Aug 22 '19 at 20:15
  • Is there some way I can fix it? I think it's damaged as well. I just don't know what I'm missing – joshua0823 Aug 22 '19 at 20:17

1 Answers1

0

To solve this issue, you have two options:

  1. for a quick fix, simply run make ARCH=<arch> CROSS_COMPILE=<cross_compiler_of_your_choice>- dtbs.
    For example: make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- dtbs
  2. you can define ARCH and CROSS_COMPILE as environment variables with export ARCH=<arch> && export CROSS_COMPILE=arm-linux-gnueabi-

Both of these solutions have drawbacks, so pick your poison:

  1. it is easy to forget to pass these variables when you run any make command, causing your build and configuration to be screwed up and not run properly as you have noticed.

  2. this only works inside the current shell or terminal, which means you should run these commands every time you open a new shell. One workaround would be to edit your shell configuration.

EDIT: make sure you check if you need to set other variables when running make but setting the two mentioned above should be enough.