-
Notifications
You must be signed in to change notification settings - Fork 35
Firmware hangup in i2c_stop()
and other I2C functions
#3
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
Comments
A timeout has been added in a72b50c and 51a22bf, further improvements in PR #45 #46 a backtrace of a lockup is also e.g.
So really the lockup can happen at any time.
The Wire library needs an overhaul regarding error / timeout checking and I2C bus resetting. I can reproduce most lock-ups very determinstically when I flash the I2C OLED benchmark demo and reflash it in the middle of when it's writing to the screen. |
i2c_stop()
i2c_stop()
and other I2C functions
Add fallback definitions in cases where the Arduino core fails to def…
I observed it multiple times in a hardware configuration with a SSD1306 I2C OLED display that reflashing the firmware at specific points would cause the new firmware to hangup in the
i2c_stop()
function (as I observed in the debugger).https://github.com/CommunityGD32Cores/GD32Core-New/blob/88d1cd79e196e13deaa67faeb7aea008f10157fd/libraries/Wire/src/utility/twi.c#L144-L155
This code does not have timeouts (as opposed to other I2C functions) and in case the I2C peripherhal wants to assert a STOP condition but the bus just doesn't let it be driven that way (some other device is interfering?) this hangs up forever.
This should be investigated and fixed.
The text was updated successfully, but these errors were encountered: