Bubble Posted October 12, 2022 Posted October 12, 2022 Armbianmonitor: http://ix.io/4cYv Hi I'm trying (and failing miserably) to achieve a simple goal with my Orange Pi 3 LTS: to have pin PD15 set as 'output-high' on startup. From reading the documentation, it seems the logical way to go about this task is to create a custom DT Overlay so that's what I set out to do. Based on the Armbian documentation and various examples I found online, I created the following sun50i-h6-gpio-pwr-status.dts file under /boot/overlay-user : /dts-v1/; /plugin/; / { compatible = "allwinner,sun50i-h6"; fragment@0 { target = <&pio>; __overlay__ { gpio_pwr_pin: gpio_pwr_pin { pins = "PD15"; function = "gpio_out"; output-high; }; }; }; fragment@1 { target = <&gpio_pwr_pin>; __overlay__ { pinctrl-names = "default"; pinctrl-1 = <&gpio_pwr_pin>; cs-gpios = <0>, <&pio 3 15 0>; /* PD15 */ }; }; }; I then ran: > sudo armbian-add-overlay sun50i-h6-gpio-pwr-status.dts (* more on the 'sun50i-h6' suffix below) And this seemed to work without errors and created a corresponding *.dtso file in the same folder. I then edited armbianEnv.txt to include the new custom overlay by adding the line: user_overlays=sun50i-h6-gpio-pwr-status Rebooted the SoC as instructed and although it booted up as usual, Pin PD15 stays 'off' and isn't set to 'output-high' (or even just 'output') at any point. I tried troubleshooting as best I can for several days now by going over forum posts and reviewing the bootup warning and error messages but nothing seemed out of order.] Also, while I understand the main 'overlay' folder (/boot/dtb/allwinner/overlay) isn't meant for placing custom overlays, I nevertheless I tried repeating the process there too, but still no go. I also tried to repeat the process without the 'sun50i-h6' suffix in the file name and in the armbian.Env entry, but that didn't change the outcome (i.e. pin PD15 remains 'off' during and after bootup). I can't even tell if this custom overlay is loading and not working or not loading to begin with. My guess there's some mistake in the custom dts file above but I can't find it and would appreciate some help in getting this to work. Thanks! 0 Quote
inx-onlya Posted November 3, 2022 Posted November 3, 2022 Maybe it should be: user_overlays=gpio-pwr-status The device name prefix is not needed, which is similar to the provided overlays. Have a look at the overlays line here: https://docs.armbian.com/User-Guide_Allwinner_overlays/#example-bootarmbianenvtxt-contents and compare that to the .dto files in the folder. You can find that the device name prefix in the filename is omitted in the overlays line. 0 Quote
Bubble Posted November 4, 2022 Author Posted November 4, 2022 Thanks for the suggestion and link @inx-onlya. I researched this aspect (i.e. naming pre-fixes) in depth and did a lot of testing with it as well so I'm certain it isn't the issue here. In a nutshell, at least in armbian, user-overlays don't require pre-fixes and are simply called in armbianEnv by their ('non-prefixed' name). The compile command from .dts to .dto adds the user-layout file name automatically to armbianEnv in the 'overlay-user' line if compilation is successful). After even more research, I'm confident it's the syntax that's wrong, but very few people seem to know how to write them from scratch and those who do don't seem to comment in forums 😞 0 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.