You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ESP32: Including Wire.h causes built-in IMU initialization to fail on Core Gray #366
Thank you for the detailed report and the fix. The fix is now merged into develop (#368) and will be in the next release.
We reproduced it on an M5Stack Gray with the M5Stack 2.1.4 board package: with Wire.h included, the built-in IMU was not found (0/40 reads), and after M5.In_I2C.release() / begin() the SDA/SCL pins stayed routed as GPIO. With the fix the IMU is found (40/40) and the port can be released and opened again (10/10).
The cause was as you described: the M5Stack 2.1.4 package does not ship core_version.h, so ARDUINO_ESP32_GIT_VER is undefined and Wire.end() was skipped on release. Your fix (WIRE_HAS_END) was taken as is, and #368 then moved the same decision into one place for the other path that ends and restores Wire (the temporary pin switcher). Without core_version.h it now uses esp_arduino_version.h (2.0.1 or later), because WIRE_HAS_END only appeared in core 2.0.5.
If you can, please try the develop branch with your sketch; if it works for you, I believe this issue can be closed.
Thank you for testing — the fix has now been released in M5GFX 0.2.34 (together with LovyanGFX 1.2.34). Please update to 0.2.34 from the library manager.
Since you confirmed it on develop, feel free to close this issue whenever it suits you.
Activity
ainyan03 commentedon Oct 20, 2026
Thank you for the detailed report and the fix. The fix is now merged into
develop(#368) and will be in the next release.We reproduced it on an M5Stack Gray with the M5Stack 2.1.4 board package: with
Wire.hincluded, the built-in IMU was not found (0/40 reads), and afterM5.In_I2C.release()/begin()the SDA/SCL pins stayed routed as GPIO. With the fix the IMU is found (40/40) and the port can be released and opened again (10/10).The cause was as you described: the M5Stack 2.1.4 package does not ship
core_version.h, soARDUINO_ESP32_GIT_VERis undefined andWire.end()was skipped on release. Your fix (WIRE_HAS_END) was taken as is, and #368 then moved the same decision into one place for the other path that ends and restoresWire(the temporary pin switcher). Withoutcore_version.hit now usesesp_arduino_version.h(2.0.1 or later), becauseWIRE_HAS_ENDonly appeared in core 2.0.5.If you can, please try the
developbranch with your sketch; if it works for you, I believe this issue can be closed.niguragu commentedon Oct 20, 2026
I tested the develop branch on my M5Stack Core Gray and confirmed that the issue is resolved.
Thank you for the fix! This issue can be closed.
ESP32 I2C: decide TwoWire::end() in one place; recover a controller l…
ainyan03 commentedon Oct 20, 2026
Thank you for testing — the fix has now been released in M5GFX 0.2.34 (together with LovyanGFX 1.2.34). Please update to 0.2.34 from the library manager.
Since you confirmed it on
develop, feel free to close this issue whenever it suits you.