[opensuse-kernel] Raspberry PI3 kernel - gpio export error

Hey I am using raspberry PI3 64bit. I am failing to export a gpio. ie; when I enter: echo 4 > /sys/class/gpio/export I get permission denied. Any idea ? -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org

Hello, On Wed, 7 Mar 2018 09:41:14 +0200 Raz <raziebe@gmail.com> wrote:
Hey
I am using raspberry PI3 64bit. I am failing to export a gpio. ie; when I enter: echo 4 > /sys/class/gpio/export
I get permission denied.
Any idea ?
Are you root? sudo does not work with > HTH Michal -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org

On Mittwoch, 7. März 2018 08:41:14 CET Raz wrote:
Hey
I am using raspberry PI3 64bit. I am failing to export a gpio. ie; when I enter: echo 4 > /sys/class/gpio/export
I get permission denied.
You more likely get -EINVAL: $> echo 4 > /sys/class/gpio/export bash: echo: write error: Invalid argument $> grep -H "" /sys/class/gpio/gpiochip*/base /sys/class/gpio/gpiochip458/base:458 The base address of the only GPIO controller on the RPI(3) is 458 in the mainline kernel. Setting the base address to 0 is a Rasbpian specific modification of the mainline kernel. This works for RPi, but is not in line with any other SoC/SBC. $> echo 462 > /sys/class/gpio/export works, but caveat below. Due to various problems with the /sys/class/gpio/ interface it is deprecated. See https://elinux.org/images/9/9b/GPIO_for_Engineers_and_Makers.pdf#page=14 ff for more details. Kind regards, Stefan -- Stefan Brüns / Bergstraße 21 / 52062 Aachen home: +49 241 53809034 mobile: +49 151 50412019

Hi, Le 08/03/2018 à 16:13, Stefan Brüns a écrit :
On Mittwoch, 7. März 2018 08:41:14 CET Raz wrote:
Hey
I am using raspberry PI3 64bit. I am failing to export a gpio. ie; when I enter: echo 4 > /sys/class/gpio/export
I get permission denied. You more likely get -EINVAL:
$> echo 4 > /sys/class/gpio/export bash: echo: write error: Invalid argument
$> grep -H "" /sys/class/gpio/gpiochip*/base /sys/class/gpio/gpiochip458/base:458
The base address of the only GPIO controller on the RPI(3) is 458 in the mainline kernel. Setting the base address to 0 is a Rasbpian specific modification of the mainline kernel. This works for RPi, but is not in line with any other SoC/SBC.
$> echo 462 > /sys/class/gpio/export works, but caveat below.
Due to various problems with the /sys/class/gpio/ interface it is deprecated. See https://elinux.org/images/9/9b/GPIO_for_Engineers_and_Makers.pdf#page=14 ff for more details.
But that is true that sysfs interface is convenient. You can also use gpio tools (lsgpio, gpio-hammer and gpio-event-mon) provided in the kernel sources. I did a quick packaging in my home. You can download it for Leap 42.3 from here: https://download.opensuse.org/repositories/home:/Guillaume_G:/ARM/openSUSE_L... Guillaume -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org
participants (4)
-
Guillaume Gardet
-
Michal Suchánek
-
Raz
-
Stefan Brüns