-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Hang in i2cdevlib when using ESP32 Board Manager v 2.0.2 #672
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
same as #670, looks like the issue is in the wire library. will do some more debugging later. |
As posted here: espressif/arduino-esp32#6674 Run pio upgrade --dev to the latest developer version and then change platform.ini If you are in fact using an esp32 board. |
I use an ESP32-C3 for normal ESP32 |
I'm not sure if this is a bug in the i2clib or in the board manager code.
I only installed the minimum set of libraries I needed in my Arduino folder:
hardware:
espressif
libraries:
ArduinoJson I2Cdev MPU6050
And in the board manager, I picked the ESP32 by Espressif board but at version 1.0.6.
I build my project and it works. This is what the console looks like when things work:
Now, I go and change the ESP32 by Espressif board support to version 2.0.2.
I build and run, and this is what I get in the console:
Ok, so where is it stuck? This is what the code looks like:
MPU6050 is the library from Jeff Rowberg. Same with I2Cdev library. Could this be a bug in either of those libraries? Or is this a bug in the 2.0.2 board support?
The hang is at
accelgyro.initialize();
this is the code from initialize():
Tracing it, I go through
setCLockSource()
and thenwritebits()
and thenreadByte()
and thenreadBytes()
:It gets stuck in this loop:
Specifically it gets stuck in
useWire->requestFrom((uint8_t)devAddr, (uint8_t)min((int)length - k, I2CDEVLIB_WIRE_BUFFER_LENGTH));
I believe the code for requestFrom() is in the Espressif hardware folder. I don't know if I should go tracing in there, or whether the problem isn't that deep.
If I switch back to board support 1.0.6, it starts to work again. I'd love to know where I should start poking around to figure out what is happening. I'd prefer to use the latest board support if at all possible.
The text was updated successfully, but these errors were encountered: