Jump to content

tinkerboard gpio resetting


iomari

Recommended Posts

Greetings,

After setting my tinkerboard pins 22 and 24 as an Inputs, they reverts to being an output pin on HIgh after around 30 seconds. What is the cause of this? Is this some kind of feature. I don't have this happen on any other pin other than these 2.

 

iomari

Link to comment
Share on other sites

2 hours ago, iomari said:

see attachment.

They are not "in-use" by any process...

So, try using them thru "sysfs" and then check again /sys/kernel/debug/gpio every 30 secs :

echo 22 > /sys/class/gpio/export
echo 24 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio22/direction
echo in > /sys/class/gpio/gpio24/direction

 

Link to comment
Share on other sites

Thanks for your reply.

I work primarily from python. But I ran the commands you suggested:

 

# sudo echo 22 > /sys/class/gpio/export
# -bash: /sys/class/gpio/export: Permission denied

 

# sudo echo in > /sys/class/gpio/gpio22/direction

# -bash: /sys/class/gpio/gpio22/direction: No such file or directory

 

Link to comment
Share on other sites

34 minutes ago, iomari said:

-bash: /sys/class/gpio/export: Permission denied

"sudo" doesn't work in such redirection, it is apply only on left part which is "echo"  only.

Try login as root first, then try again, or do it this way :

sudo su - -c "echo 22 > /sys/class/gpio/export"
sudo su - -c "echo in > /sys/class/gpio/gpio22/direction"

 

Link to comment
Share on other sites

same problem:

 

# sudo su -c echo in > /sys/class/gpio/gpio/export

# -bash: /sys/class/gpio/gpio/export: No such file or directory

 

# sudo su -c echo in > /sys/class/gpio/gpio/gpio22/direction

-bash: /sys/class/gpio/gpio/gpio22/direction: No such file or directory

 

as root:

 

root@TK-03:~# echo in > /sys/class/gpio/gpio/export
-su: /sys/class/gpio/gpio/export: No such file or directory

 

root@TK-03:~# echo in > /sys/class/gpio/gpio22/direction
-su: /sys/class/gpio/gpio22/direction: No such file or directory

 

root@TK-03:~#

 

 

Link to comment
Share on other sites

thanks.

 

sco@TK-03:/$sudo su - -c "echo 24 > /sys/class/gpio/export"

sco@TK-03:/$ sudo su - -c "echo in > /sys/class/gpio/gpio24/direction"
-su: line 0: echo: write error: Invalid argument

 

sco@TK-03:/$ sudo su - -c "echo 26 > /sys/class/gpio/export"
sco@TK-03:/$ sudo su - -c "echo in > /sys/class/gpio/gpio26/direction"
-su: line 0: echo: write error: Invalid argument

 

 

sco@TK-03:/$ su -l
Password:
root@TK-03:~# echo 'in' >  /sys/class/gpio/gpio26/direction
-su: echo: write error: Invalid argument
root@TK-03:~# ls -la /sys/class/gpio/gpio26/
total 0
drwxr-xr-x  3 root root    0 Sep 25 14:02 .
drwxr-xr-x 38 root root    0 Sep 25 14:02 ..
-rw-r--r--  1 root root 4096 Sep 25 14:02 active_low
lrwxrwxrwx  1 root root    0 Sep 25 14:02 device -> ../../../pinctrl
-rw-r--r--  1 root root 4096 Sep 25 14:16 direction
-rw-r--r--  1 root root 4096 Sep 25 14:02 edge
drwxr-xr-x  2 root root    0 Sep 25 14:02 power
lrwxrwxrwx  1 root root    0 Sep 25 14:02 subsystem -> ../../../../../class/gpio
-rw-r--r--  1 root root 4096 Sep 25 14:02 uevent
-rw-r--r--  1 root root 4096 Sep 25 14:02 value

 

export works, 2nd line doesn't

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines