Hi,

> -----Original Message-----
> From: Simon Gleissner <si...@gleissner.de>
> Sent: 10 March 2019 22:32
> To: opensuse-arm@opensuse.org
> Subject: [opensuse-arm] libgpiod on RasPi 3B+ apparently does not work
>
> I'm using Tumbleweed JeOS (20190308, aarch64) on a RaspberryPI 3B+, which
> works astonishingly good and stable.
>
> During my attempts to use the GPIOs with libgpiod, i've found that the GPIOs
> are not named as they should be. Also setting GPIOs does not seem to work,
> if they are changed with gpioset.
>
> Regarding the naming of the GPIOs, all of them are unnamed:

I think it is because we use an upstream kernel which does not name it. I guess 
this would not be too difficult to get it, but someone need to make the patch 
and upstream it.

>
> # gpioinfo pinctrl-bcm2835
> gpiochip0 - 54 lines:
>          line   0:      unnamed       unused   input  active-high
>          line   1:      unnamed       unused   input  active-high
>          line   2:      unnamed       unused   input  active-high
>          line   3:      unnamed       unused   input  active-high
>          line   4:      unnamed       unused   input  active-high ...
>          line  29:      unnamed       "led0"  output  active-high [used]
>          line  30:      unnamed       unused  output  active-high
>          line  31:      unnamed       unused  output  active-high ...
>          line  47:      unnamed       unused  output  active-high ...
>
> There are references for Raspian, that the 'unnamed' entries should contain
> the GPIO names, e.g. at https://www.beyondlogic.org/an-introduction-to-
> chardev-gpio-and-libgpiod-on-the-raspberry-pi/
> .
>
> Also the "led0" and other output-GPIOs do not match in their position.
> It seems that there is a mismatch in the device tree and I think the
> Tumbleweed kernel uses a generic .dts config file, whereas Raspian uses an
> adapted one.

It should match just fine. On my RPi3 B, it does match.

>
> I have checked the mailing list and found, that the problem is not new:
> https://lists.opensuse.org/opensuse-arm/2018-09/msg00000.html
>
> I also have found an article in the opensuse wiki, which describes the
> functionality, but does not help with the mapping:
> https://en.opensuse.org/openSUSE:GPIO
>
> Additionally, I have tried setting all possible GPIOs with libgpiod's gpioset
> (some of them crashed the system), but it was not possible to change the
> GPIO output (I've connected a LED). However, with the deprecated sysfs
> GPIO subsystem this worked instantly without any problems (with offset
> N=458).

I have updated this wiki page now to use '--mode=wait' option. Otherwise, this 
tool set the GPIO to 1 and exit immediately and release the GPIO and does not 
set it anymore and you will not notice that anything happened. With wait mode, 
press ctrl-c to stop setting the value.

>
> Question: did anyone here succeeded in using libgpiod for setting GPIOs in
> Tumbleweed yet?

On Tumbleweed 20190308, with my RPi3 B, the following command just works to set 
GPIO26 to 1 (3V3) :
gpioset --mode=wait  gpiochip0 26=1

Could you test the '--mode=wait' option, please?

Thanks,
Guillaume

IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
N�����r��y隊Z)z{.�櫛맲��r��z�^�ˬz��N�(�֜��^�       ޭ隊Z)z{.�櫛�0�����Ǩ�

Reply via email to