I tested J21 pin 18 and it does seem suspicious.
J21 pin 18 maps to MDM_WAKE_AP (which has a 1.8V on SoC side, but goes through a level shifter on J21). This touches the M.2 slot. Do you have anything in the M.2? Or any drivers for hardware which might go in the M.2?
There does seem to be some bug related to this. For reference, I am using R28.1. For GPIO 481 these two directories may be relevant (481 must be exported first for this to show up):
…in theory these are the same due to symbolic links.
For everything below I’m using sudo.
Start with a fresh cold boot. Go to “/sys/class/gpio/” and export 481, then cd to “/sys/devices/2200000.gpio/gpio/gpio481/”. “echo out > direction”. If you “cat direction” it will say out.
If I then measure pin 18 voltage I get 0 volts (which matches “value” being “0” at the start). If I then echo “1” to “value” the voltage goes up to 1.56V.
Mostly when I “echo 0 > value” the “value” register shows “0”, but actual pin voltage does not drop. Sometimes it does. Keep doing this repeatedly on the command line (assumes already exported and direction out) while monitoring pin 18 voltage:
echo 1 > value ; cat value
echo 0 > value ; cat value
This seems to imply something is not seeing the change on echo to value to 0, but it seems changing value to 1 always works. Getting back to “0” seems to require a cold boot (warm boot won’t reset it…this seems wrong since reboot goes back to “in” and not exported). dmesg does not say anything.
It is possible the device tree is related to this (I have not looked), but it seems odd that if the device tree is causing an issue that sometimes the echo to value works on the pin, but not always (and in fact echo 0 rarely works on actual pin voltage)…but echo followed by cat of value always says it succeeded.
If I echo “in” to direction, then the pin voltage remains at 1.56V. I don’t think this should happen unless there is something else going on.
Are there current patches needed for J21 pin 18 to function as regular GPIO as export of 481?