PINE64

Full Version: i2c-bus kernel modules
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello forum.

I am running debian on a pine64 (2GB) and i want to access a device on the i2c-bus.

While two busses show up (/dev/i2c-0 and i2c-1) i can not see my device using i2cdetect.

I tried "modprobe i2c-dev" but it does not show up in lsmod after that. Usually there also has to be a kernel module for the processor (i2c_bcm2xxx) that is loaded before i2c-dev, but i can't find it. Is it implemented yet for the cortex 53?


Does anyone have ideas what i could try next? Afaik a change in the /boot/config has to be made for the raspberry pi3. Is there maybe a similar change neccessary for the pine?

a bit more data maybe:

Code:
root@pine64pro:/home/debian# ls -l /dev/i2c-*
crw-rw---- 1 root i2c 89, 0 Jun  2 19:51 /dev/i2c-0
crw-rw---- 1 root i2c 89, 1 Jun  2 19:51 /dev/i2c-1

Code:
root@pine64pro:/home/debian# i2cdetect -l
i2c-0    i2c           twi0                                I2C adapter
i2c-1    i2c           twi1                                    I2C adapter


Code:
root@pine64pro:/home/debian# lsmod
Module                  Size  Used by
vfe_v4l2              747618  0
vfe_io                 34085  1 vfe_v4l2
mali                  199851  0
videobuf2_dma_contig    17668  1 vfe_v4l2
videobuf2_memops       12546  1 videobuf2_dma_contig
videobuf2_core         30952  1 vfe_v4l2
ss                     33083  0
cedar_ve               17368  0
8723bs               1365012  0
cfg80211              374207  1 8723bs
Since "i2cdetect -l" has detected the buses, did you try to scan them with "i2cdetect -y 0" and "i2cdetect -y 1" ?
(06-03-2016, 07:47 AM)martinayotte Wrote: [ -> ]Since "i2cdetect -l" has detected the buses, did you try to scan them with "i2cdetect -y 0" and  "i2cdetect -y 1" ?

Thanks for your reply. Yes i did, but i get all blanks ("--") on all adresses on both busses, although at least one i2c device is connected (via the pi header).
What kind of device it is ? Are you sure that it is properly connected ?
(06-03-2016, 09:16 AM)martinayotte Wrote: [ -> ]What kind of device it is ? Are you sure that it is properly connected ?

it was a SN2318 led-controller. to be sure it's not a dead chip i just connected an LM75 temperature sensor, which is a relatively simple chip. same as before (it should show up on address 7):

Code:
root@pine64pro:/home/debian# i2cdetect -y 0
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                        
root@pine64pro:/home/debian# i2cdetect -y 1
    0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --                

I have read that on the raspberry pi it is neccessary to load i2c-dev (which should be active here, otherwise i would not see the /dev/i2c-files, right?) and a second kernel module, that allows to access the processors i2c-bus (usually called i2c_bcm8xxx).

Is this module maybe missing? Or is it included in the 8723bs or the vfe-io?

It seems strange that the buses show up, but not their connected devices.
I don't have much clues since the bus are showing but empty.
On my Pine64, I have it running fine with an MCP23017 GPIO expander.
I don't have any kernel module to load since I've compiled my own kernel from longsleep repo with the CONFIG_I2C_CHARDEV=y, so built-in in the kernel.
Are you using pin 3 and 5 on Pi header ? Are you sure you didn't invert them ?
You can also check if DTS is properly set by doing "hd /proc/device-tree/soc\/pinctrl\/twi1\@0/allwinner\,pins", it should display "PH2.PH3".
thanks for bearing with me Smile

the command spits out:

00000000  50 48 32 00 50 48 33 00                           |PH2.PH3.|
00000008

i have tested with a ready made module (that has a pi type connector, so i can't confuse the pins) and with the LM75, on which i checked the connections multiple times (because that was my first thought too).

could you maybe post what lsmod answers on your system?

if the software checks out i will have a look at the pine's hardware tomorrow, to see if i get at least a clock or anything over the bus.
As I said, at least in my case with my own-built kernel, the I2C isn't driven by a modules, it is part of the main Image.

But if you still wish to see :

root@pineA64:~# lsmod
Module Size Used by
vfe_v4l2 744474 0
videobuf2_dma_contig 8764 1 vfe_v4l2
vfe_io 30197 1 vfe_v4l2
videobuf2_memops 1722 1 videobuf2_dma_contig
videobuf2_core 24008 1 vfe_v4l2
cedar_ve 13200 0
ss 31587 0
8723bs 1344342 0
cfg80211 369159 1 8723bs
ppdev 6380 0
parport 18857 1 ppdev
[SOLVED] i now get my i2c device detected, and have no idea why Big Grin

i did a re-setup of debian from scratch. i must have broken something along the way Sad

thank you very much for your patience and help martinayotte
you're welcome !
Pages: 1 2