-
Notifications
You must be signed in to change notification settings - Fork 2.1k
cpu/sam0_common/periph_i2c: reliably unstuck bus #21891
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
cpu/sam0_common/periph_i2c: reliably unstuck bus #21891
Conversation
crasbe
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it make sense to alter the success variable if the bus-unsticking was successful?
Can't really comment on the function of the code, as I don't have the hardware nor experience with the SAM0 in general.
|
I think there are still some other factors that I do not fully understand yet. |
On a setup I have on my desk I can reliably get the I2C bus stuck. But the current unstuck logic will not get it unstuck. Adding a full reset of the SERCOM does fix the issue, though. Co-authored-by: crasbe <[email protected]>
1b5be2e to
0967c6b
Compare
|
This now reliably unstucks the I2C bus on my very very cursed setup. I'm quite confident that this will also reliably work on much less cursed setups. |
benpicco
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look nice and small too
|
Thx a lot ❤️ |

Contribution description
On a setup I have on my desk I can reliably get the I2C bus stuck. But the current unstuck logic will not get unstuck it. Adding a power cycle of the I2C bus to the unstuck logic does fix the issue, so let's do that.
Testing procedure
I2C should still work. E.g. as seen here on the
same54-xpro:In addition, when the bus gets stuck, the current I2C transaction does indeed still fail. But subsequent transactions will work again.
In
masterusing my cursed setup, the bus would stay stuck once it is stuck and never recover.Issues/PRs references
None