3

I have tried on two different Pi's (2 and zero) with fresh installs and have the same problem.

I have i2c enabled via device tree via raspi-config.

When I run i2cdetect -y 1 without anything plugged into the GPIOs I expect it to return

root@raspberrypi:/root# 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: -- -- -- -- -- -- -- --

In about 1000 to 1500 ms. Just like it always has on any RPi I have worked on.

What happens is that I get the same output, it just takes 115 SECONDS which is painful to watch. Checking /var/log/syslog I have a lot of

Mar  7 16:36:13 raspberrypi kernel: [  933.094755] i2c i2c-1: transfer timed out
Mar  7 16:36:14 raspberrypi kernel: [  934.094746] i2c i2c-1: transfer timed out
Mar  7 16:36:15 raspberrypi kernel: [  935.094750] i2c i2c-1: transfer timed out
Mar  7 16:36:16 raspberrypi kernel: [  936.094772] i2c i2c-1: transfer timed out

But I can not find anything either on stackexchange or googling that helps. I have a co-worker that has a similar problem (4 seconds per i2c address on scan).

I would expect this behavior if I had a bad device connected or bad wiring or something, but this is without anything plugged into the GPIO pins at all. Plugging in known good i2c sensors has the same result and the sensors do not respond. I have a few other Pi's but they are in use and I don't want to take them down to test with if I don't have to.

****edit****

On my RPI2

I just re-imaged an SD with the 2-9-16 Jessie Lite image.

Booted.

raspi-config expand filesystem, enable i2c and load modules at boot.

apt-get update
apt-get install i2c-tools

Still takes 115 seconds to scan the entire address range.

root@raspberrypi:~# apt-get install i2c-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  libi2c-dev python-smbus
The following NEW packages will be installed:
  i2c-tools
0 upgraded, 1 newly installed, 0 to remove and 27 not upgraded.
Need to get 51.3 kB of archives.
After this operation, 227 kB of additional disk space will be used.
Get:1 http://archive.raspberrypi.org/debian/ jessie/main i2c-tools armhf 3.1.1+svn-2 [51.3 kB]
Fetched 51.3 kB in 0s (74.9 kB/s)
Selecting previously unselected package i2c-tools.
(Reading database ... 30238 files and directories currently installed.)
Preparing to unpack .../i2c-tools_3.1.1+svn-2_armhf.deb ...
Unpacking i2c-tools (3.1.1+svn-2) ...
Processing triggers for man-db (2.7.0.2-5) ...
Setting up i2c-tools (3.1.1+svn-2) ...
/run/udev or .udevdb or .udev presence implies active udev.  Aborting MAKEDEV invocation.
root@raspberrypi:~# i2cdetect -l
i2c-1   i2c             3f804000.i2c                            I2C adapter
root@raspberrypi:~# 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: -- -- -- -- -- -- -- --

Next step I transferred the sd card to the Pi Zero and booted.

root@raspberrypi:~# i2cdetect -l
i2c-1   i2c             20804000.i2c                            I2C adapter
root@raspberrypi:~# 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: -- -- -- -- -- -- -- --
root@raspberrypi:~#

Took the appropriate amount of time (less than 1 sec.)

So. Hardware problem on the Pi2?

  • I have not heard of any similar problems. Mine times 0.042 seconds for an i2cdetect. I'd try an rpi-update. – joan Mar 7 '16 at 17:35
  • I am running off of the 2/26/16 official release. Linux raspberrypi 4.1.18-v7+ #846 SMP Thu Feb 25 14:22:53 GMT 2016 armv7l GNU/Linux – Christopher McDonald Mar 7 '16 at 22:51
  • I have possibly isolated it to the RPi2. I have added info to the original question. – Christopher McDonald Mar 7 '16 at 23:15
2

I've been having this problem as well, on a Raspberry Pi 2 with kernel 4.1.19-v7+, and have a workaround, at least.

It's not just the i2cdetect program that has the issue, as I have another I²C program written myself that also gets timeouts.

I'm able to get it working again by either rebooting the Pi, or, for less interruption:

sudo rmmod i2c_bcm2708
sudo rmmod i2c_dev
sudo modprobe i2c_dev
sudo modprobe i2c_bcm2708

It immediately starts working fine after this.

Looks like it could be a problem with the BCM2708 driver itself? Im not sure.

While this isn't a perfect solution, hopefully it helps you for now.

I've reported this issue here: https://github.com/raspberrypi/linux/issues/1379

If they report back any sort of suggestions or a fix, I'll update here as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.