Skip to content

Bad i2c dev recovery #388

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Bad i2c dev recovery #388

wants to merge 3 commits into from

Conversation

sampscl
Copy link

@sampscl sampscl commented Feb 22, 2019

This fixes the issue I reported to platformio. The downside is that startTransmissionWIRE() will immediately return an error on a multi-master I2C bus when another master currently owns the bus. Previous behavior was to wait indefinitely until the other master released the bus.

@sandeepmistry sandeepmistry requested a review from facchinm March 5, 2019 20:14
@facchinm
Copy link
Member

facchinm commented Mar 6, 2019

From the logic POW this patch looks fine; @sampscl do you have any test case that can help reproducing the issue in a specially crafted misbehaving multimaster setup?

@sampscl
Copy link
Author

sampscl commented Mar 6, 2019

I will work on it, maybe next week or the week after I'll have something?

Some history: I originally found this when I put an SMBUS battery we had laying around the lab onto my existing I2C bus so I could develop a smart battery interface. It turns out that SMBUS devices are multi-master and this particular one has some bug that causes it to inhibit the I2C stop condition in very rare circumstances (recently charged to 100%, drained a little bit maybe 97%, then start charging again and simultaneously queried for it's current battery state -- at least this was the most common condition when I saw the Arduino I2C deadlock). Check out my attached logic analyzer capture for reference. I'll probably need to write some software to intentionally cause the issue so that it can be repeatedly observed outside my lab.

i2c-smbus-fail

@CLAassistant
Copy link

CLAassistant commented Apr 9, 2021

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ sampscl
❌ asserta6
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants