[SOLVED] i2cdetect -y 1 failing with "i2c_designware 808622C1:04: controller timed out"

waynepiekarskiwaynepiekarski New Member Posts: 13
edited April 29 in UP Board Linux

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?

Tagged:

Best Answer

Answers

  • DCleriDCleri Administrator, AAEON Posts: 759 admin

    Hi @waynepiekarski

    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 -a

    What kernel is now running your system?

    Have you tried to run the same command as root?

  • waynepiekarskiwaynepiekarski New Member Posts: 13

    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.

    [email protected]$ uname -a
    Linux myhostname 4.9.45-ubilinux+ #1 SMP Tue Aug 29 11:41:15 IST 2017 x86_64 GNU/Linux
    [email protected]:~$ cat /sys/bus/acpi/devices/808622C1:01/status
    15
    [email protected]:~$ ls /sys/devices/pci0000:00/808622C1:01/
    driver  driver_override  firmware_node  i2c-1  modalias  power  subsystem  uevent
    
    [email protected]:~$ 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 -- -- -- -- -- -- 77

    So 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?

  • waynepiekarskiwaynepiekarski New Member Posts: 13

    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
    [email protected]:~$ cat /sys/bus/acpi/devices/808622C1:01/status
    15
    [email protected]:~$ ls /sys/devices/pci0000:00/808622C1:01/
    driver  driver_override  firmware_node  i2c-5  modalias  power  subsystem  uevent
    [email protected]:~$ 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.

  • ccaldeccalde New Member Posts: 348 admin

    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.B2C

    Cheers!

Sign In or Register to comment.