AnsweredAssumed Answered

Why won't my GPIO read anything other than 0?

Question asked by Josh Barnheiser on Mar 12, 2018
Latest reply on Mar 13, 2018 by Fabio Estevam


I have a custom iMX6 board with multiple GPIO pins on it being used. All of the GPIOs that I am using as outputs work and all but one of my inputs work. The input that is not working has the same voltage divider and filtering capacitors as the other inputs, so the circuitry is the same. For some reason GPIO7_IO01 always reads 0 regardless of whether the input pin is at 0V or 3.3V. I use the below commands to read the input:


echo 193 >> /sys/class/gpio/export

echo in >> /sys/class/gpio/gpio193/direction

cat /sys/class/gpio/gpio193/value


In my device tree, I have tried with the pin not specified as anything and throwing in pinctrl_hog set as below:


 MX6QDL_PAD_SD3_DAT4__GPIO7_IO01            0x0001B0B0


In both cases, 0 is always read. The SD3 pins are not being used for an SDIO interface. I am using four of the SD3 pins for my two CAN interfaces (CMD, CLK, DAT0 and DAT1). Some of the other pins are being used for GPIO (DAT6, DAT7 and RST) and they work. The other GPIO are not specified in the device tree.


I am really at a loss for this one, any ideas?