GPIO input error : Set gpio mode failed, missing file or invalid permissions.

193 views
Skip to first unread message

gupta niks

unread,
Mar 20, 2019, 11:12:04 AM3/20/19
to BeagleBoard

I'm using Adafruit_BBIO python library for GPIO Input. Cape Universal.dtb is disabled.
Output works fine but INput throws the error. ValueError: Set gpio mode failed, missing file or invalid permissions.
Below is dts for the gpio input

/dts-v1/;

/ {
    compatible = "ti,beaglebone", "ti,beaglebone-black";
    part-number = "gpiotest-00A0";
    version = "00A0";

    fragment@0 {
        target = <0xffffffff>;

        __overlay__ {

            gpiotest_Pins {
                pinctrl-single,pins = <0x2c 0x37 0x8c 0x37 0x20 0x37 0xcc 0x37 0xc8 0x37>;
                linux,phandle = <0x1>;
                phandle = <0x1>;
            };
        };
    };

    fragment@1 {
        target = <0xffffffff>;

        __overlay__ {

            helper {
                compatible = "bone-pinmux-helper";
                pinctrl-names = "default";
                pinctrl-0 = <0x1>;
                status = "okay";
            };
        };
    };

    __fixups__ {
        am33xx_pinmux = "/fragment@0:target:0";
        ocp = "/fragment@1:target:0";
    };

    __local_fixups__ {

        fragment@1 {

            __overlay__ {

                helper {
                    pinctrl-0 = <0x0>;
                };
            };
        };
    };
};


Please suggest the issue and help with the solution.
Thank You.

Dennis Lee Bieber

unread,
Mar 20, 2019, 12:55:35 PM3/20/19
to beagl...@googlegroups.com
On Wed, 20 Mar 2019 05:07:32 -0700 (PDT), gupta niks
<gupta.ni...@gmail.com> declaimed the
following:

>
>I'm using Adafruit_BBIO python library for GPIO Input. Cape Universal.dtb
>is disabled.
>Output works fine but INput throws the error. *ValueError: Set gpio mode
>failed, missing file or invalid permissions.*
>Below is dts for the gpio input
>

The library (based upon source) relies upon using sysfs access to the
pins. I would presume (I don't read device trees; they are mysteries to me)
cape-universal creates all the needed entries for all sysfs manipulation.
If your custom DT doesn't provide the same, anything could happen.

https://github.com/adafruit/adafruit-beaglebone-io-python/blob/master/source/py_gpio.c
line 117 through 151 (the actual error is one of the calls in 142/144/146
-- but note the other operations that may be needed)

https://github.com/adafruit/adafruit-beaglebone-io-python/blob/master/source/c_pinmux.c
is the actual code for setting the mode, and expects something in
/sys/devices/platform/ocp/<something_pinmux>/state
into which the mode is written.


--
Wulfraed Dennis Lee Bieber AF6VN
wlf...@ix.netcom.com HTTP://wlfraed.home.netcom.com/

Reply all
Reply to author
Forward
0 new messages