xu4 minimal gpio functions

Moderators: mdrjr, odroid

xu4 minimal gpio functions

Unread postby codyhanks » Thu Dec 07, 2017 6:13 pm

We are working towards using the newer 16.04 minimal img as a replacement for our older image due to the recent changes from 5.0 to 5.1 eMMC however I am having some issues with default functions of gpio pins.

Code: Select all
#gpio mode switch
sudo echo "22" > /sys/class/gpio/export
sudo echo "in" > /sys/class/gpio/gpio22/direction
#gpio
sudo echo "18" > /sys/class/gpio/export
sudo echo "in" > /sys/class/gpio/gpio18/direction
#gpio
sudo echo "29" > /sys/class/gpio/export
sudo echo "in" > /sys/class/gpio/gpio29/direction
#gpio
sudo echo "21" > /sys/class/gpio/export
sudo echo "in" > /sys/class/gpio/gpio21/direction
sudo echo "rising" > /sys/class/gpio/gpio21/edge
#GPIO
sudo echo "30" > /sys/class/gpio/export
sudo echo "out" > /sys/class/gpio/gpio30/direction
sudo echo "1" > /sys/class/gpio/gpio30/value
#GPIO
sudo echo "19" > /sys/class/gpio/export
sudo echo "out" > /sys/class/gpio/gpio19/direction
sudo echo "1" > /sys/class/gpio/gpio19/value
#GPIO
sudo echo "24" > /sys/class/gpio/export
sudo echo "out" > /sys/class/gpio/gpio24/direction
sudo echo "1" > /sys/class/gpio/gpio24/value
#GPIO
sudo echo "25" > /sys/class/gpio/export
sudo echo "out" > /sys/class/gpio/gpio25/direction
sudo echo "1" > /sys/class/gpio/gpio25/value
#GPIO
sudo echo "28" > /sys/class/gpio/export
sudo echo "out" > /sys/class/gpio/gpio28/direction
sudo echo "1" > /sys/class/gpio/gpio28/value


however when looking into /sys/class/gpio/
I don't see GPIO 28 or 25

why would they not export?
codyhanks
 
Posts: 7
Joined: Thu Dec 07, 2017 5:38 pm
languages_spoken: english
ODROIDs: xu3,xu4,c1,c2

Re: xu4 minimal gpio functions

Unread postby codyhanks » Thu Dec 07, 2017 6:40 pm

So with some further deduction GPIO 25 is being held by the SPI in "lsmod" -> "spi_s3c64xx" by black listing this I get access to GPIO 25 however then I lose the SPI Dev in /dev/spidev-1.0..... I need both to be available. ? any help on this.
codyhanks
 
Posts: 7
Joined: Thu Dec 07, 2017 5:38 pm
languages_spoken: english
ODROIDs: xu3,xu4,c1,c2

Re: xu4 minimal gpio functions

Unread postby odroid » Fri Dec 08, 2017 9:23 am

Show me your full "lsmod" output.
User avatar
odroid
Site Admin
 
Posts: 25303
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: xu4 minimal gpio functions

Unread postby codyhanks » Fri Dec 08, 2017 10:09 am

here ....
Code: Select all
operator@odroid:~$ lsmod
Module                  Size  Used by
cp210x                  8947  0
usbserial              19389  1 cp210x
spidev                  5934  2
spi_s3c64xx            11643  0
exynos_gpiomem          3162  0
ipv6                  339508  54
operator@odroid:~$
codyhanks
 
Posts: 7
Joined: Thu Dec 07, 2017 5:38 pm
languages_spoken: english
ODROIDs: xu3,xu4,c1,c2

Re: xu4 minimal gpio functions

Unread postby odroid » Fri Dec 08, 2017 12:00 pm

GPIO #25 is not related to the SPI interface.
https://wiki.odroid.com/odroid-xu4/hard ... connectors

What is "ls /dev/spi*" output ?
User avatar
odroid
Site Admin
 
Posts: 25303
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: xu4 minimal gpio functions

Unread postby codyhanks » Tue Dec 12, 2017 10:12 am

operator@odroid:~$ ls /dev/spi*
/dev/spidev1.0
codyhanks
 
Posts: 7
Joined: Thu Dec 07, 2017 5:38 pm
languages_spoken: english
ODROIDs: xu3,xu4,c1,c2

Re: xu4 minimal gpio functions

Unread postby odroid » Tue Dec 12, 2017 10:44 am

Kernel 4.x has "/dev/spidev0" instead of "/dev/spidev-1.0".

Which kernel version do you use?
The latest kernel should be
Code: Select all
odroid@odroid:~$ uname -a                                                                                                                 
Linux odroid 4.14.5-92 #1 SMP PREEMPT Mon Dec 11 15:48:15 UTC 2017 armv7l armv7l armv7l GNU/Linux
User avatar
odroid
Site Admin
 
Posts: 25303
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID


Return to Ubuntu

Who is online

Users browsing this forum: No registered users and 1 guest