i2c-bus kernel modules
#1
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
  Reply
#2
Since "i2cdetect -l" has detected the buses, did you try to scan them with "i2cdetect -y 0" and "i2cdetect -y 1" ?
  Reply
#3
(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).
  Reply
#4
What kind of device it is ? Are you sure that it is properly connected ?
  Reply
#5
(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.
  Reply
#6
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\@01c00000/pinctrl\@01c20800/twi1\@0/allwinner\,pins", it should display "PH2.PH3".
  Reply
#7
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.
  Reply
#8
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
  Reply
#9
[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
  Reply
#10
you're welcome !
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  (ARCHIVED) Debian Jessie Images (3.10.102 BSP Kernel) New Release lenny.raposo-pine64.pro 259 460,000 05-21-2018, 06:30 AM
Last Post: Luke
  how to set kernel parameter 'fsck.mode=force' marcelser 6 11,972 05-09-2018, 09:07 PM
Last Post: pfeerick
Question Debian Jessie with 4.x.y kernel and complete hardware support? Spark 2 5,733 04-24-2017, 09:56 PM
Last Post: Spark
  Adding a missing kernel module spz2k 8 11,362 01-10-2017, 06:22 AM
Last Post: xalius
  NIC not visible after kernel update xleon 1 3,122 11-15-2016, 05:23 PM
Last Post: xleon
  [OUTDATED] Debian Jessie (4.7.0-rc1 Kernel) Images fire219 4 17,081 07-20-2016, 02:36 PM
Last Post: umiddelb
  How to install modules into system? MicroDiery 6 7,448 05-27-2016, 06:44 PM
Last Post: JamesHarris
  Debian kernel upgrade question jl_678 2 4,564 04-18-2016, 05:54 PM
Last Post: jl_678

Forum Jump:


Users browsing this thread: 1 Guest(s)