Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Compile Device Tree Overlay

Featured Replies

Hi,

 

I use kernel version 4.19.62-sunxi on my Orange Pi One and I want compile the following devide tree overlay:

 

/dts-v1/;
/plugin/;

/ {
	compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";

	fragment@0 {
		target = <&pio>;
		__overlay__ {
			gpio_button_0: gpio_button_0 {
				pins = "PA20";
				function = "gpio_in";
				bias-pull-up;
			};
		};
	};

	fragment@1 {
		target-path = "/";
		__overlay__ {
			gpio-keys-user {
				compatible = "gpio-keys";
				pinctrl-names = "default";
				pinctrl-0 = <&gpio_button_0>;

				power_button {
					label = "GPIO Key Power";
					linux,code = <KEY_POWER>;
					gpios = <&pio 0 20 GPIO_ACTIVE_LOW>;
				};
			};
		};
	};
};

 

dtc -I dts -O dtb -o overlay-user/test.dtbo overlay-user/gpio-poweroff.dts

 

But the DTC outputs the following error:

 

Error: overlay-user/gpio-poweroff.dts:2.2-8 syntax error
FATAL ERROR: Unable to parse input tree

 

What is wrong with this overlay?

Solved by kampi

linux,code = <KEY_POWER>;
gpios = <&pio 0 20 GPIO_ACTIVE_LOW>;

 

These two lines. When compiling outside of the kernel source, constants like GPIO_ACTIVE_LOW don't get resolved because they don't have the kernel headers included in the compilation path.

 

If you have the linux kernel sources downloaded, a simple grep will tell you what they're supposed to be.

 

tparys@wander:linux/include/dt-bindings$ grep -r GPIO_ACTIVE_LOW .
./gpio/gpio.h:#define GPIO_ACTIVE_LOW 1

 

I'd also check that KEY_POWER is correct. That's not part of the 5.10 mainline, as far as I see.

 

In the future, just comment out parts of your dtc overlay until it compiles, and add parts back in until it breaks. Should narrow your problems down pretty quick.

  • Author

Hi,

 

sorry, but this doesn´t solve the problem. I reduce the overlay to 

 

/dts-v1/;
/plugin/;

/ {
	compatible = "allwinner,sun4i-a10", "allwinner,sun7i-a20", "allwinner,sun8i-h3", "allwinner,sun50i-a64", "allwinner,sun50i-h5";

	fragment@0 {
		target = <&pio>;
		__overlay__ {
			gpio_button_0: gpio_button_0 {
				pins = "PA20";
				function = "gpio_in";
				bias-pull-up;
			};
		};
	};
};

 

and I still have the same problem.

  • Author

I can compile the fragment on my Raspberry Pi with DT 1.4.7, so there is definitely an issue with the version. How can I update the DTC on my OrangePi? Using apt doesn´t work, because I have the current version already.

1.5.1-1 is current as of Ubuntu Focal. Perhaps a version difference in Debian, or an outdated install?

 

The output of "armbianmonitor -u" might help.

  • Author
vor 2 Stunden schrieb tparys:

1.5.1-1 is current as of Ubuntu Focal. Perhaps a version difference in Debian, or an outdated install?

 

The output of "armbianmonitor -u" might help.

mmh the command doesn´t output an URL.

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.