[SOLVED] i2cdetect -y 1 failing with "i2c_designware 808622C1:04: controller timed out"
I have a new Up board running Ubuntu 18.04 with the updated Up kernel running on it. When I try to run i2cdetect to scan for an I2C device connected on pins 2 and 3 (marked SDA and SCL for i2c-1), then I get the error message:
i2c_designware 808622C1:04: controller timed out
There is also a warning at the top:
Warning: Can't use SMBus Quick Write command, will skip some addresses.
My user account is in the correct group, and I can access the device just fine.
When I connect the exact same hardware to a Raspberry Pi 3, it works fine, so the I2C hardware and wiring should be all fine, since the pinouts are the same.
I am also having problems getting the UART to work as well, not sure if this is related. Is there a trick to make I2C work?
Best Answer
-
You appear to be accessing the wrong I2C controller for some reason. That error message shows "808622C1:04" but the correct I2C controller connected to pins 2-3 is "808622C1:01"
In addition to the information requested by DCleri above, can you also post the output of the following 2 commands:
cat /sys/bus/acpi/devices/808622C1:01/status # should be 15, if BIOS settings are ok ls /sys/devices/pci0000:00/808622C1:01/ # this will give you the correct Linux I2C bus number to use, if the path exists
Please use the following command when scanning the I2C bus on an UP board:
sudo i2cdetect -r -y 5 # Replace 5 with the correct Linux I2C bus number if different - see previous command above
Answers
-
What BIOS are you using on your board? Is the last one available installed on your board?
Also can you verify with the command:
$ uname -aWhat kernel is now running your system?
Have you tried to run the same command as root?
-
Thanks for your replies. Since I made the post, I nuked the system and installed the Emutex Ubilinux distribution, but was still having problems with the error about SMBus Quick Write not being available. My user account was in the i2c group so it should not need root to access anything.
My BIOS version is R1.5 from 11/09/2018.
wayne@myhostname$ uname -a Linux myhostname 4.9.45-ubilinux+ #1 SMP Tue Aug 29 11:41:15 IST 2017 x86_64 GNU/Linux wayne@myhostname:~$ cat /sys/bus/acpi/devices/808622C1:01/status 15 wayne@myhostname:~$ ls /sys/devices/pci0000:00/808622C1:01/ driver driver_override firmware_node i2c-1 modalias power subsystem uevent wayne@myhostname:~$ i2cdetect -y 1 Error: Can't use SMBus Quick Write command on this bus
However, if I pass in the -r option, then it looks like something is working:
$ i2cdetect -y -r 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 41 -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: 70 -- -- -- -- -- -- 77So it looks like the -r flag was what did the trick. Why is this necessary?
Also, it seems like standard Ubuntu 18.04 needs to have a special kernel from you added on. I'm assuming the Emutex UbiLinux includes the right kernel ready to go for this device to support GPIO and everything else I need?
-
Ok, I just reinstalled the machine with Ubuntu 18.04, then updated the kernel using https://wiki.up-community.org/Ubuntu#Install_Ubuntu_kernel_4.15.0_for_UP_from_PPA_on_Ubuntu_18.04 and then followed your instructions to find the correct device:
$ uname -a Linux myhostname 4.15.0-37-generic #40~upboard04-Ubuntu SMP Thu Feb 14 13:49:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux wayne@myhostname:~$ cat /sys/bus/acpi/devices/808622C1:01/status 15 wayne@myhostname:~$ ls /sys/devices/pci0000:00/808622C1:01/ driver driver_override firmware_node i2c-5 modalias power subsystem uevent wayne@myhostname:~$ i2cdetect -r -y 5 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: 40 41 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 70: 70 -- -- -- -- -- -- 77
On the Ubuntu system, it appears on i2c-5 whereas previously it was i2c-1.
So in summary, there were many issues here:
1. When I made the posting, I hadn't installed the updated kernel 4.15.0 yet.
2. The -r argument makes the SMBus error message go away, and makes the scan actually return the correct results
3. The i2c assignment changes depending on the OS
4. The settings in the BIOS are critical as well, but I already set that up.Thanks for your help with troubleshooting this, especially with how to find the correct device id. It would be really good if there was one step-by-step guide on how to get this all working, and a lot of the existing guides are out of date or have broken links.
-
Hi @waynepiekarski ,
Thanks for your update.
I just upgraded the UP Wiki information for I2C. Always remembering to use our supported kernel for UP family boards.
https://wiki.up-community.org/Pinout#I.C2.B2CCheers!