On Mon, Jun 26, 2023 at 05:09:50AM +0000, Tay Ivan (AquaEasy) wrote: > Hi, > > Does anyone knows how to access and write to the Intel J4125 board GPIO? > I have tried using the raspberrypi GPIO tools and it cannot detect the > hardware pins. You mean the raspberrypi GPIO tools that use /dev/gpiomem to access the pi hardware directly?? I would be horrified if it did. > I have tired to load the gpio-it87 module and the gpiochip0 shows up > (using gpiodetect) but I am unable to change the pin values, meaning > using gpioset (gpioset 0 0=0 or gpioset 0 0=1) writing a 1 or 0 changes > nothing because the read (gpioget 0 0) always return 1. Note that by default gpioget changes the line direction to an input and then reads it, so that whatever you set using gpioset will be lost. You need to physically check the pin, or use the libgpiod v2 version of gpioget that supports the --as-is option to read the line without changing its direction. And even then, and depending on the device driver, when gpioset exits the line may be set back to its default value. So you need to keep gpioset running (the libgpiod v1 gpioset exits by default, whereas the v2 gpioset will not). You are almost certainly using v1 gpioset, so try `gpioset -m wait 0 0=1` and then check the pin. Alternatively, externally pull a line and use gpioget to check the value read with gpioget is correct. Just be sure you have the correct pin. TL;DR As gpiochip0 is recognised by gpiodetect, there is a very good chance it IS working, but the other tools have convinced you otherwise. Cheers, Kent.