Closed Erriez closed 5 years ago
Does it work with upstream version? http://docs.platformio.org/en/latest/platforms/espressif32.html#stable-and-upstream-versions
Unfortunately, it does not work with this upstream branch: It reads only zero's as well.
Wire.endTransmission(false); // < Generate repeated start with false reads only zero's
Wire.endTransmission(true); // < Generate new start with true works
Stumbled upon this issue while trying to find out why my BNO055 (9DoF sensor) was suddenly returning only zeros after updating to 1.5.0. Is there a workaround for us to use in the meanwhile?
Stumbled upon this issue while trying to find out why my BNO055 (9DoF sensor) was suddenly returning only zeros after updating to 1.5.0. Is there a workaround for us to use in the meanwhile?
I suggest you to overwrite the existing sources from the ESP32 master branch (as workaround):
https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-i2c.c https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-i2c.h https://github.com/espressif/arduino-esp32/blob/master/libraries/Wire/src/Wire.cpp https://github.com/espressif/arduino-esp32/blob/master/libraries/Wire/src/Wire.h
Should be fixed in Arduino ESP32 core. See docs how you can switch to development version of this framework https://docs.platformio.org/en/latest/platforms/espressif32.html#using-arduino-framework-with-staging-version
I think the problem is still there, could you check it @ivankravets
Do you use the latest version of dev/platform? Please open PlatformIO IDE Terminal and type pio update
.
If you still experience this issue, please report to https://github.com/espressif/arduino-esp32/issues
The following example reads zero's when generating an I2C repeated start:
Incorrect output of the example above with a repeated start
Wire.endTransmission(false);
:0x00 0x00 0x00 0x00 0x00 0x00 0x00
Valid data is set on the I2C bus with a repeated start, but the receive data is not read correctly in the ESP32 I2C driver. Screenshot valid I2C signals measured with a logic analyzer:
Valid ouput when change repeated start to a stop - start condition
Wire.endTransmission(true);
:0x17 0x47 0x21 0x07 0x29 0x07 0x18
This bug is already fixed in the official Espressif branch: https://github.com/espressif/arduino-esp32/commit/b05430cfd9f273d627baa6c4dac6c215d6cde902#diff-64fd3b24e81f73a1c0e49b5738154bc8
Sources: https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-i2c.c https://github.com/espressif/arduino-esp32/blob/master/cores/esp32/esp32-hal-i2c.h https://github.com/espressif/arduino-esp32/blob/master/libraries/Wire/src/Wire.cpp https://github.com/espressif/arduino-esp32/blob/master/libraries/Wire/src/Wire.h
Replacing the sources above works. Can someone backport this?