Skip to content

i2c failing to initialize and detect devices #6057

Open

Description

@EdgarSouSousa

Describe the bug

The i2c bus fails to detect and communicate with connected i2c devices. Dmesg output:
[ 1.878285] i2c_dev: i2c /dev entries driver
[ 2.368416] brcmstb-i2c 107d508200.i2c: @97500hz registered in interrupt mode
[ 2.380348] brcmstb-i2c 107d508280.i2c: @97500hz registered in interrupt mode
[ 63.352260] i2c_designware 1f00074000.i2c: i2c_dw_handle_tx_abort: lost arbitration
[ 63.352340] i2c_designware 1f00074000.i2c: i2c_dw_handle_tx_abort: lost arbitration
[ 63.352408] i2c_designware 1f00074000.i2c: i2c_dw_handle_tx_abort: lost arbitration
[ 63.352476] i2c_designware 1f00074000.i2c: i2c_dw_handle_tx_abort: lost arbitration
[ 63.352564] i2c_designware 1f00074000.i2c: i2c_dw_handle_tx_abort: lost arbitration
[ 63.352627] i2c_designware 1f00074000.i2c: i2c_dw_handle_tx_abort: lost arbitration
[ 63.352703] i2c_designware 1f00074000.i2c: i2c_dw_handle_tx_abort: lost arbitration

Steps to reproduce the behaviour

Enable the i2c interface using raspi-config
Connect any i2c device
run sudo i2cdetect -y 1
sudo dmesg | grep i2c

Device (s)

Raspberry Pi 5

System

Raspberry Pi reference 2024-03-15

2024/02/16 15:28:41
Copyright (c) 2012 Broadcom
version 4c845bd3 (release) (embedded)

Linux raspberrypi-722 6.6.21-v8-16k+ #1 SMP PREEMPT Mon Mar 18 17:00:44 UTC 2024 aarch64 GNU/Linux

Logs

No response

Additional context

I have already flashed a new image , installed most recent firmware and tried with multiple i2c devices

Activity

  1. pelwell commented on Mar 21, 2024

    @pelwell
    Contributor

    Likely duplicate of #6056.

    1. Which devices are attached?
    2. Have you set the I2C clock rate?
    3. When it fails, what does pinctrl 2-3 show?
  2. EdgarSouSousa commented on Mar 21, 2024

    @EdgarSouSousa
    Author
    1. Currently attached a VEML7700 sensor
    2. I have not , I simply enabled the i2c using raspi-config
    3. 2: a3 pu | hi // GPIO2 = SDA1 3: a3 pu | hi // GPIO3 = SCL1

    Thank you for your speedy response

  3. pelwell commented on Mar 21, 2024

    @pelwell
    Contributor

    Is that a self-built kernel? If so, what was the head-of-tree? If not, where did it come from?

  4. EdgarSouSousa commented on Mar 21, 2024

    @EdgarSouSousa
    Author

    It is not a self built kernel, I updated the kernel when facing the issues using 'sudo apt full-upgrade'.

    Thank you.

  5. popcornmix commented on Mar 21, 2024

    @popcornmix
    Collaborator
    Linux raspberrypi-722 6.6.21-v8-16k+ https://github.com/raspberrypi/linux/issues/1 SMP PREEMPT Mon Mar 18 17:00:44 UTC 2024 aarch64 GNU/Linux
    

    It is not a self built kernel, I updated the kernel when facing the issues using 'sudo apt full-upgrade'.

    from RPiOS bookworm?

    That doesn't seem right. The latest apt version is 6.6.20 (2024-03-07)

  6. pelwell commented on Mar 21, 2024

    @pelwell
    Contributor

    Thanks - I was just coming to the same conclusion

  7. EdgarSouSousa commented on Mar 21, 2024

    @EdgarSouSousa
    Author

    I apologize for my mistake, I forgot i tried to upgrade the kernel previously to posting this issue, as seen in #6056 (comment).

    The issue was first encountered in the latest apt version and persisted to the version present in pull 6050.

  8. pelwell commented on Mar 25, 2024

    @pelwell
    Contributor

    A VEML7700 arrived in the post today and it is showing this behaviour. I can make it fail on vanilla 6.1 kernels, so I don't think it is a new issue. There seem to be situations where it is behaving in a non-compliant fashion, but the failure should not kill the I2C bus in the way it does.

  9. pelwell commented on Mar 26, 2024

    @pelwell
    Contributor

    PR #6071 is a fix/workaround for the bus lockup. It's still not clear to me what your system is doing to provoke the problem - is it really just i2cdetect -y 1?

  10. EdgarSouSousa commented on Mar 27, 2024

    @EdgarSouSousa
    Author

    Originally the issue was found after attempting to read from the i2c slave, and after failure I ran i2c detect. After reboot the issues persists, when just running i2cdetect -y 1. At a later date I will attempt with the new workaround and with a fresh RaspberryPi5.

    Thank you.

  11. 303 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions