-
-
Notifications
You must be signed in to change notification settings - Fork 7k
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 hang whole avr - probably twi library loops #7328
Comments
This is a known issue
There are some proposed solutions but pull request were never merged, so you can cherry-pick or merge them into your own fork of Arduino to use them in your project. |
I'm closing this issue, in favor of arduino/ArduinoCore-avr#42 (which is in the, now, correct repository). |
It's been 9 [expletive deleted] YEARS since that bug was first discussed (2011), countless people pulled their hair trying to understand why their Arduino was freezing, why would it work normally, then suddenly stop, a dozen of times, it's been raised in here, dozens of times people had been told to get lost, use something else, etc ... If the fix was difficult, if it compromised compatibility or added other problem, it would be understandable, but it's not the case, all that [expletive deleted] is caused by those 2 damn lines of code that obviously can create an infinite loop if for some reason the read operation does not complete : // wait for read operation to complete
while(TWI_MRX == twi_state){
continue;
} Yes, I know, this state is not supposed to happen according to the I2C protocol, but guess what ? electrical glitches didn't get the memo. Countless people, after losing hours or days kind of solved the issue either by making a modified version for themselves, or switching to another library, so there are several implementations of a timeout that are simple and would easily solve the issue. But arduino developpers stubbornly refuse to fix it ! You think I'm rude ? After 9 years of giving the finger on this issue to the whole community for absolutely no reason, I couldn't care less. How long before you close it again ? |
Why i2c/wire library does not have any timeout fuses? Its known issue froam a years and still no solutions.
Its my 4th project where endTransmission or requestFrom hang my avr.
probably hanging code:
In worst case I should receive error or corrupted data so I can repeat operation. Haging whole avr beacuse some random noise on I2C line or damaged I2C device (in some situations) is not acceptet in my opinion. And as I said, many peoples complains on that form a years and still no solutions.
The text was updated successfully, but these errors were encountered: