-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
esp32: i2c_read() error was returned successfully at the bus nack #45008
Comments
Closes zephyrproject-rtos#45008 Signed-off-by: Lucas Tamborrino <[email protected]>
Closes #45008 Signed-off-by: Lucas Tamborrino <[email protected]>
Hello :) I'm working on a couple new I2C drivers for Zephyr (Sensirion SCD4X/SEN5X, X-Powers AXP192 PMIC, and a few others found on M5Stack ESP32 boards), and by chance I ended up rebasing my local tree right after the above commit (092406b) was merged. I'm seeing some odd behavior now with ESP32 i2c peripheral, specifically rx buffers that contain invalid responses from i2c devices, which is noticeable because Sensirion includes a CRC covering the sensor data in the I2C response itself. With that commit applied, I started seeing CRC failures not only with my new drivers but with drivers that are already in the Zephyr tree. When I revert it everything works. I wiped out my zephyr tree and reinstalled the toolchain to avoid any local quirks, branched off from main again without any of my new code included, and ran some of the samples. Here's
Same sample with 092406b reverted:
|
@steveatinfincia Thanks for reporting this issue. PR #46174 should resolve your problem. |
@huarunlin did you have any luck with your AXP192 driver? |
Hi. Were you able to finish developing an I2C drivers for both the SCD4x and SEN5x sensors? |
Describe the bug
I use i2c_read() to read slave data. After sending the slave address on the bus, if the slave does not reply to ack, i2c_read() error returns the read success.
To Reproduce
esp32.overlay
main.c
Steps to reproduce the behavior:
Logs and console output
Environment (please complete the following information):
Additional context
I guess it is because the ACK ERR interrupt is not used in the i2c_read() processing, and the esp32 cannot generate the ACK ERR flag without enabling the ACK ERR interrupt. So I modified i2c_esp32.c, i2c_read() can return error correctly.
i2c_esp32.c
The text was updated successfully, but these errors were encountered: