Skip to content
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

Properly initialize Wire on ESP32 #35

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

gimdh
Copy link

@gimdh gimdh commented Jun 12, 2023

Wire now seems to require method begin() to be called before beginTransmission(). This patch accomodates such new requirement by executing _i2cPort->begin(); if Wire is used.

Tested on Lolin32, and can confirm it works now with the fix. Not sure if this change should be specifically applied for ESP32, or can be generalized to non-TEENSY3_I2C implementations.

Error message

[581391][E][Wire.cpp:422] beginTransmission(): could not acquire lock
[581392][E][Wire.cpp:526] write(): NULL TX buffer pointer
[581392][E][Wire.cpp:448] endTransmission(): NULL TX buffer pointer
[581398][E][Wire.cpp:481] requestFrom(): NULL buffer pointer

Related links

https://community.platformio.org/t/updating-espressif-32-to-5-2-0-breaks-wire-cpp/30282/2
espressif/arduino-esp32@9bceb28
https://github.com/espressif/arduino-esp32/blob/master/libraries/Wire/src/Wire.cpp#L278-L308

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant