Tinker Board Forum

Full Version: [SOLVED] Cannot compile any dts files - FATAL ERROR: Unable to parse input tree
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

I'm running standard stretch 2.0.7 on a non S model.

I've been looking at porting a super simple dts file which has one button over to the Tinkerboard but have hit a problem. It seems that I cannot compile ANY dts files. I've tried other examples from this forum but none get past the first line of the file without throwing an error.

Installed in the normal way i.e. "sudo apt-get install device-tree-compiler".
linaro@tinkerboard:~/source$ uname -a
Linux tinkerboard 4.4.103+ #1 SMP Fri Jun 22 16:14:49 CST 2018 armv7l GNU/Linux
linaro@tinkerboard:~/source$ dtc -v
Version: DTC 1.4.2
linaro@tinkerboard:~/source$ dtc -I dts -O dtb -o  ./example.dtbo  ./example.dts
Error: ./example.dts:2.2-8 syntax error
FATAL ERROR: Unable to parse input tree

Here is my dts file - it's undoubtedly wrong in the details but that's not the point:

/ {
   compatible = "rockchip,rk3288-miniarm", "rockchip,rk3288";

   fragment@0 {
       target = <&gpio>;
       __overlay__ {
           button25_pin: button25_pin {
               rockchip,pins = <6>;    
               rockchip,function = <0>; /* input */
               rockchip,pull = <2>;     /* pull-up */

   fragment@1 {
   target-path = "/soc";
       __overlay__ {
           button25: button25 {
               compatible = "gpio-keys";
               #address-cells = <1>;
               #size-cells = <0>;
               pinctrl-names = "default";
               pinctrl-0 = <&button25_pin>;
               status = "okay";

               button@25 {
                   label = "button gpio25";
                   linux,code = <4>;
                   gpios = <&gpio 6 1>;

Any help would be appreciated.
Managed to fix this:

1. Clone kernel source from github
git clone https://github.com/TinkerBoard/debian_kernel.git
ln -s ~/debian_kernel /usr/src/linux-headers-$(uname -r)

2. Rebuild using instructions from here except DON'T INSTALL NEW KERNEL as it seems to kill the WiFi.

3. Copy newly made dtc over the installed one
linaro@tinkerboard:~$ sudo cp /usr/src/linux-headers-4.4.103+/scripts/dtc/dtc /usr/bin
linaro@tinkerboard:~$ dtc -v
Version: DTC 1.4.5-gc1e55a55

4. Compile a super simple dts file!  Big Grin

IMO it's a bit crazy I had to do all this for something so simple