Gpiochip and libpiod not working

Hi friends,

I'm new using OpenWrt, and I have encountered some problems trying to manipulate the Gpins.
Notice: I'm a new user of OpenWrt and also Linux embedded system. Coming from microcontrollers programming, all this nonsense to access GPIO is quite odd to me.

I have had access to GPIO pins before using the sysfs system, but because this way have been deprecated, I want to include the my gpio controller using the libgpiod.
I believe I installed all packages and libs needed before building my custom system, but things are not working as expected.

  • First, I don't have any gpio chip on dev/
  • On sys/class/gpio , I can see a gpiochip0 which have info corresponding to my chip, like number of pins, pins description, etc.
    -On usr/bin I can see: gpiodetect, gpiofind, gpioinfo, etc. But using the commands doesn't return anything.
    -Also my custom package who is using gpiod.h, I tried functions like
    gpiod_chip_open("sys/class/gpio/")
    gpiod_chip_open_by_name("gpiochip0")
    etc,
    NO WORKING NEITHER; it's not detecting any gpiochip.

Maybe there is somewhere a manual "Enable" that I am missing, in order of getting visible a gpiochip inside dev/

This is part of my "config.buildinfo"
Screenshot (1627)

My board is atsam5d2, but I also tried with a raspberry pi. No idea what I am doing wrong.

Thanks

https://openwrt.org/docs/techref/hardware/port.gpio

But you also need to have the pin controller initialized in the dts file.

Personally I also think PIC microcontrollers have easier IO handling than OS based hardware.