G-Virus
Posts: 16
Joined: Mon Feb 15, 2016 2:31 pm
Location: Zagreb, Croatia

i2c-dev does not create an i2c-* in /dev

Tue Jan 30, 2018 12:55 am

Hello everyone. I'm configuring my own linux image for RaspberryPi 2B from the official linux kernel 4.9.78-v7+ for Raspberry. I've done and it works but I have a problem with i2c interface.

I have two strings in /etc/sysconfig/modules file:

Code: Select all

# I2C interface
i2c-dev
i2c-bcm2708
Also I have i2c-dev built as module. At startup the module is loading successfully but I can't see any i2c-* devices in /dev directory. I've tried to remove the module and insert it again. It shows the following output:

Code: Select all

[email protected]: ~ # modprobe i2c-dev
[  112.440052] i2c /dev entries driver
[email protected]: ~ #
but there is no any i2c devices in /dev as before.

I have dtparam=i2c_arm=on enabled in config.txt and I don't have any special rules for udev in /etc/udev/rules.d/. Please guys, your ideas what the problem?

Thanks in advance

G-Virus
Posts: 16
Joined: Mon Feb 15, 2016 2:31 pm
Location: Zagreb, Croatia

Re: i2c-dev does not create an i2c-* in /dev

Wed Jan 31, 2018 11:14 pm

It is definitely because of kernel or modules or firmware. I just downloaded PiLFS image and replaced boot parition except cmdline and config files, replaced /lib/modules and /lib/firmware then rebooted Raspberry and i2c-1 has appeared. What could be disabled in the default configuration of Raspberry Linux Kernel 4.9.78?

ivannaz
Posts: 15
Joined: Fri May 22, 2015 7:42 pm

Re: i2c-dev does not create an i2c-* in /dev

Wed Feb 13, 2019 3:24 pm

I have this same behavior.

I dare to say that:
- if you build the master branch of the buildroot system, as of today or last week, accepting everything default, and only adding userspace programs;
- add
dtparam=i2c_arm=on
dtparam=spi=on
at the end of config.txt,

and boot, you do not get /dev/i2c anything. You could modprobe i2c-dev to no avail (despite the one line dmesg entry). Neither help modprobing i2c-bcm2708.

lsmod gives then:

Code: Select all

Module                  Size  Used by    Not tainted
i2c_bcm2708            16384  0 
i2c_dev                16384  0 
ipv6                  434176 18 [permanent]
and yet no i2c entries on /dev/

I also wonder what is missing.

DirkS
Posts: 10130
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: i2c-dev does not create an i2c-* in /dev

Wed Feb 13, 2019 4:33 pm

Which OS / kernel version?
I don't see i2c_bcm2708, but i2c_2835 on both Pi 0 and 3b
Don't know if it makes a difference though...

If you're not running standard Raspbian (Lite) using an RPF image then I would suggest you take your spare SD card and install that first.
Enable i2c using raspi-config

ivannaz
Posts: 15
Joined: Fri May 22, 2015 7:42 pm

Re: i2c-dev does not create an i2c-* in /dev

Wed Feb 13, 2019 7:45 pm

Yes, thank you.

modprobe i2c-bcm2835 did the trick.

Somehow I associated the "2835" with some older pi versions, and have not tried it before.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7916
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: i2c-dev does not create an i2c-* in /dev

Wed Feb 13, 2019 9:17 pm

i2c_bcm2708 is the old driver, i2c_bcm2835 is the newer one.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Advanced users”