Installing IO Shield

Moderators: mdrjr, odroid

Installing IO Shield

Unread postby DHundt2 » Sat Mar 14, 2015 3:17 am

Hi,
I upgraded from microSD (old Class2 -.-') to eMMC with ubuntu 14.04 pre-installed.
While I mangaged to install and control the io/shield (rev0.2) in the old setup, now I have serious problems.
I looked through some threads in this board, tried some tipps, but I wasn't successfull.
Sorry :(

For now I tried the following:
Code: Select all
sudo su

modprobe gpio-pca953x
# no error


apt-get install i2c-tools
i2cdetect -l
# gpio-4 not showing therefor...

modprobe i2c-dev
modprobe i2c_gpio_custom bus0=4,200,199
# no error, gpio-4 is available in i2cdetect

i2cdetect -y 4
############
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
############

echo tca6416 0x20 > /sys/devices/platform/i2c-gpio.4/i2c-4/new_device
# got some "permission denied" or "Invalid argument" in first place, but sometimes it seams to work

echo 289 > /sys/class/gpio/export
# write error: No such device

cat /proc/version
# Linux version 3.8.13.30 (root@xu-b1) (gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-12ubuntu1) ) #1 SMP PREEMPT Wed Mar 4 17:26:56 BRT 2015


What did I do wrong?
Last edited by DHundt2 on Sat Mar 14, 2015 4:23 pm, edited 1 time in total.
DHundt2
 
Posts: 5
Joined: Sat Mar 14, 2015 2:57 am
languages_spoken: german, english
ODROIDs: u3 + io/shield rev0.2

Re: Installing IO Shield

Unread postby odroid » Sat Mar 14, 2015 10:17 am

I think you didn't load the I2C host driver.
http://odroid.com/dokuwiki/doku.php?id=en:u3_ioport_i2c
User avatar
odroid
Site Admin
 
Posts: 28859
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID

Re: Installing IO Shield

Unread postby DHundt2 » Sat Mar 14, 2015 4:21 pm

Thanks for your answer, but as I mentioned above, I already tried that before.

The driver (?) seams to be loaded, but "echo 289 > /sys/class/gpio/export" won't work. :(
Code: Select all
lsmod
########
Module                  Size  Used by
gpio_pca953x            8109  0
i2c_gpio_custom         1619  0
i2c_dev                 5465  0
ipv6                  293783  35
rfcomm                 31665  0
bnep                   10804  2
bluetooth             197729  10 bnep,rfcomm
rt2800usb              15172  0
rt2800lib              62366  1 rt2800usb
rt2x00usb              10180  1 rt2800usb
rt2x00lib              40535  3 rt2x00usb,rt2800lib,rt2800usb
mac80211              241261  3 rt2x00lib,rt2x00usb,rt2800lib
smsc95xx               19047  0
usbnet                 20016  1 smsc95xx
cfg80211              186133  2 mac80211,rt2x00lib
gpio_keys               7074  0
fuse                   64662  0
vfat                    9060  1
fat                    48463  1 vfat
########

/sys/class/gpio# l2|grep "gpio*"
########
gpiochip0
gpiochip105
gpiochip114
gpiochip121
gpiochip130
gpiochip136
gpiochip144
gpiochip152
gpiochip16
gpiochip160
gpiochip168
gpiochip177
gpiochip181
gpiochip190
gpiochip199
gpiochip208
gpiochip217
gpiochip226
gpiochip233
gpiochip238
gpiochip245
gpiochip25
gpiochip254
gpiochip263
gpiochip272
gpiochip281
gpiochip31
gpiochip341
gpiochip37
gpiochip42
gpiochip47
gpiochip53
gpiochip62
gpiochip69
gpiochip78
gpiochip87
gpiochip9
gpiochip96
########
DHundt2
 
Posts: 5
Joined: Sat Mar 14, 2015 2:57 am
languages_spoken: german, english
ODROIDs: u3 + io/shield rev0.2

Re: Installing IO Shield

Unread postby Panzerknacker » Sat Mar 14, 2015 4:58 pm

Are your GPIOs in /sys/kernel/debug/gpio?
User avatar
Panzerknacker
 
Posts: 239
Joined: Sat Feb 22, 2014 10:08 pm
languages_spoken: German, English
ODROIDs: U3, X, XU, XU3, XU4, W

Re: Installing IO Shield

Unread postby Panzerknacker » Sat Mar 14, 2015 5:02 pm

Maybe the number 289 is wrong.
Do the /sys/class/gpio# l2|grep "gpio*"
with and without your GPIO-chip and compare the numbers.
User avatar
Panzerknacker
 
Posts: 239
Joined: Sat Feb 22, 2014 10:08 pm
languages_spoken: German, English
ODROIDs: U3, X, XU, XU3, XU4, W

Re: Installing IO Shield

Unread postby DHundt2 » Sat Mar 14, 2015 5:03 pm

Code: Select all
less /sys/kernel/debug/gpio
####
...
GPIOs 281-287, GPZ:

GPIOs 341-356, i2c/4-0020, tca6416, can sleep:
####
DHundt2
 
Posts: 5
Joined: Sat Mar 14, 2015 2:57 am
languages_spoken: german, english
ODROIDs: u3 + io/shield rev0.2

Re: Installing IO Shield

Unread postby DHundt2 » Sat Mar 14, 2015 5:07 pm

OK, now it's working with
echo 356 > /sys/class/gpio/export

Thanks for the hint ;-)

Is there a way to change it back to 289?
Last edited by DHundt2 on Sat Mar 14, 2015 5:12 pm, edited 1 time in total.
DHundt2
 
Posts: 5
Joined: Sat Mar 14, 2015 2:57 am
languages_spoken: german, english
ODROIDs: u3 + io/shield rev0.2

Re: Installing IO Shield

Unread postby Panzerknacker » Sat Mar 14, 2015 5:12 pm

No, cause CONFIG_SAMSUNG_GPIO_EXTRA has been set to 64 from 16 to have the possibility to connect more GPIO-chips to I2C.
Read this for the history behind:
viewtopic.php?f=80&t=8243#p64112
User avatar
Panzerknacker
 
Posts: 239
Joined: Sat Feb 22, 2014 10:08 pm
languages_spoken: German, English
ODROIDs: U3, X, XU, XU3, XU4, W

Re: Installing IO Shield

Unread postby DHundt2 » Sat Mar 14, 2015 5:13 pm

OK. Thank you very much for your support :D
DHundt2
 
Posts: 5
Joined: Sat Mar 14, 2015 2:57 am
languages_spoken: german, english
ODROIDs: u3 + io/shield rev0.2


Return to Hardware and peripherals

Who is online

Users browsing this forum: No registered users and 3 guests