Where can I get or build the gpiod Library? - doesn't come in when I build my project

I am trying to run an interrupt routine, off of an input that pulses high. I am using the gpiod library to run an interrupt routine. The problem is that it was running continously. It wasn’t actually having a rising edge as it appears. Additionally , the original code I read said that when you call:
gpiod_line_event_wait(gLine, timeout); if the timeout was NULL, it would wait forever. But instead it returns immediately with a -1 result. So, I thought it was had timed out, even though it wasn’t supposed to do that if it was NULL.
So, I stopped checking the value, and I instead read the event type and check it against a raising edge, (which it says in the example code should never fail) and it does.
I want to rebuild the library so I can debug what is happening. Where can I get the source for gpiod?


Greetings @Evets,

I want to rebuild the library so I can debug what is happening. Where can I get the source for gpiod?

On quick google search this leads to here: libgpiod/libgpiod.git - C library and tools for interacting with the linux GPIO character device

Best Regards,

1 Like

Hi @Evets

Did you try using gpioutils from shell? Perhaps your pad isn’t available for GPIO and requires change in DT.

Hi @jeremias.tx ,
What I was hoping for is for the version that you have under Toradex 6. This has many versions, and the newest is completely different from what was used, it is hardly recognizable.

No, it is unused. I have used it as an output before.

So, I figured out what the problem was. I wasn’t calling the
gpiod_line_request_rising_edge_events function to set it up. Must’ve missed that somehow. Anyway, it is working now…

Glad you were able to solve your issue. For future reference you can easily check the version of whatever packages you installed in your container like libgpiod.

You can either just check the Debian website: Debian -- Details of package libgpiod2 in bookworm

Or you could just check in the container itself:

root@1071188cf862:/# apt show libgpiod2
Package: libgpiod2
Version: 1.6.3-1+b3
Priority: optional
Section: libs
Source: libgpiod (1.6.3-1)
Maintainer: SZ Lin (林上智) <szlin@debian.org>
Installed-Size: 233 kB
Depends: libc6 (>= 2.33), libgcc-s1 (>= 3.0), libstdc++6 (>= 5.2)
Homepage: https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git
Tag: role::shared-lib
Download-Size: 37.6 kB
APT-Manual-Installed: yes
APT-Sources: http://deb.debian.org/debian bookworm/main arm64 Packages
Description: C library for interacting with Linux GPIO device - shared libraries

Most of the packages you install in the Debian container come from the standard Debian feeds. Therefore the versions of these packages are not a conscious decision by Toradex, outside of which Debian release we base our containers.

Best Regards,