-
Notifications
You must be signed in to change notification settings - Fork 72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I2C reads always returning 0xFF (as of 2.7.4+rev1) #172
Comments
Hi, |
Of course 😀 We have been testing against an Atlas Scientific RTD module: https://www.atlas-scientific.com/product_pages/circuits/ezo_rtd.html connected to a Raspberry Pi 3. Testing under 2.9.7+rev1 (same result w/ 2.7.4+):
Testing under 2.7.2+rev1:
Note that this first register (address 0) is the device identification register. It should always return 0x05. |
After performing some additional testing, it appears as though the new releases only cause issues when communicating with our Atlas Scientific I2C devices. We also tested against a BME280 sensor and did not notice any issues when upgrading to the latest resinOS. I grabbed a few captures via our logic analyzer of the Atlas Scientific transactions. Note that the top (BAD) test was performed on resinOS 2.12.3+rev1. The bottom (GOOD) test was performed on resinOS 2.7.2+rev1. It appears as though the newer resinOS builds are attempting to perform a repeated start. The Atlas Scientific module we are using does not support repeated start. In fact, if you look closely at the (BAD) analog waveforms (below the digital waveforms), you can see a slight voltage increase in SCL after SDA goes high (indicating that the Pi is attempting to perform a repeated start). Because the change is ~150mV, this would seem to indicate that the slave device is holding the clock low to prevent the repeated start. Is it possible the underlying I2C drivers have changed to perform repeated starts? And if so, is there any way to prevent this? |
We've now tracked this issue down to a change in the official RPi kernel. It appears that when the bcm2835 I2C module was made the default (with repeated starts enabled), it broke compatibility with our Atlas Scientific board. This change can be found here: Will continue to investigate on our own. But closing as this is not a resinOS specific issue. |
Thanks, @ericbarch for investigating this. It was hard on our side as we lack the specific hardware. Update us if we can help in any way. |
Although we're still debugging this one on our end, I wanted to create this issue in case anyone else has run into this.
Starting with release 2.7.4+rev1, all of our I2C reads began returning 0xFF. In 2.7.2+rev1 and prior, this behavior is not observed.
We have tested several releases since 2.7.4 (including 2.9.7+rev1) and find the same behavior. Reverting back to 2.7.2+rev1 or earlier always resolves this issue.
Note that scanning devices (via i2cdetect) behaves as expected. Even writing to the I2C device succeeds. We are performing our tests via a Debain container with privileged mode enabled on a Raspberry Pi 3.
The text was updated successfully, but these errors were encountered: