-
Notifications
You must be signed in to change notification settings - Fork 50
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 timeout error #88
Comments
Maybe related to lovyan03/LovyanGFX#382? |
Hello, @sylque |
Hi @lovyan03 , |
@lovyan03 , please find here a program to reproduce the issue: https://github.com/sylque/i2c_bug In order to compile it, you'll need to make a small change to your local M5Unified library, as explained in The program displays the elapsed seconds until it hangs, usually between 0 and 300 seconds. Typical output (with
As you will see, the program uses BLE. I could only reproduce the issue when using IMU+BLE. |
@sylque |
The fix seems to work nicely on my side. Thank you @lovyan03 ! |
@lovyan03 , unfortunately the issue is still there. It's quite baffling because it appeared to have been resolved previously, but it has now resurfaced. To reproduce the issue , I'm using https://github.com/sylque/i2c_bug with this modified
As far as I can see, your fix is indeed included in the build. |
Our team is facing a similar issue. After this line, he added the following code, which seems to recover the error. i2c_context[i2c_port].unlock(); below this line: https://github.com/m5stack/M5GFX/blob/0.1.15/src/lgfx/v1/platforms/esp32/common.cpp#L1409 if (0 == getRxFifoCount(dev))
{
i2c_stop(i2c_port);
ESP_LOGW("LGFX", "i2c read error : read timeout");
res = cpp::fail(error_t::connection_lost);
i2c_context[i2c_port].state = cpp::fail(error_t::connection_lost);
i2c_context[i2c_port].unlock();
return res;
} Anyone care to test this workaround? |
Hello, @sylque @alwint3r . The previous fix was to solve the problem of errors occurring when an interrupt occurred during I2C communication, but there was another bug. I have just made a new fix and updated the develop branch. This fix resolves the bug that prevented communication if an error occurred during I2C reading. It is best if I2C communication does not cause errors, but we have now made it so that it can return to normal even if an error does occur. Please try this version. |
@alwint3r, @lovyan03, sorry for being late on this. @lovyan03 I've just tested the latest dev branch and unfortunately the issue is still there, although less frequent. It seems to occur after 15 minutes on average, with the following error message:
@alwint3r, your fix seems to work. I've got it running for more than 4 hours without issue. |
The issue is still there with the latest commit in the #develop branch:
(what has changed compared to 3 months ago, though, is that now the M5Unified library gracefully ignore the error instead of hanging) |
On my two M5StickC-PLUS2, I get the following error:
It happens randomly.
It seems to happen only when using the IMU.
When it happens, my single (user) task hangs, but the BLE task remains active.
The text was updated successfully, but these errors were encountered: