-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
I2C Probe Timeout on STM32G070 Revision Y with New ESP-IDF I2C Driver (Works on Revision B & Old Driver) (IDFGH-14869) #15589
Comments
Could you provide your code that can produce this problem? And btw, check if I understand correctly:
Could you also provide the waveform captured by a logic analyzer? When we can't figure out what happen, we need to make sure whether ESP is sending correct command and the slave really reply with an ACK. |
Check your online data please. |
@ginkgm yes, the problem is exactly as you described. In this test, I used the new I2C driver along with the i2ctools example code, where I increased the I2C timeout. The source code used is as follows:
I executed the i2cdetect command via the console. Here are the logic analyzer captures: Revision B: Revision Y: As @mythbuster5 pointed out, the SCL line is stretched with revision Y. However, interestingly, we do not experience this issue when using the legacy I2C driver. |
New driver uses totally different logic. So it's hard to imagine a stretch could happen during a device probe. May you try to add a line code in function Please try and give a feedback, thanks! @BatuhanKaratas |
When I applied your suggested change, the probe completed successfully. Actually, the timeout parameter you mentioned already exists at the device level as follows:
If we incorporate this into the i2c_master_probe function as well, it will allow us to probe devices that implement clock stretching. |
Answers checklist.
IDF version.
v5.5-dev-1998-gc71d74e2f8
Espressif SoC revision.
ESP32-S3 (QFN56) (revision v0.2)
Operating System used.
Windows
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
CMD
Development Kit.
Custom Board
Power Supply used.
USB
What is the expected behavior?
Our ESP32-S3 processor is acting as an I2C master, and we have two different revisions of STM32G070CBT processors acting as I2C slaves. We are using the new version of the I2C driver, and we are testing with the "i2ctools" example project from the master branch.
When using STM32G070CBT Revision B, performing an I2C probe at address 0x51 results in a positive response, meaning the STM32 I2C bootloader is successfully detected and communicating as expected.
What is the actual behavior?
When using STM32G070CBT Revision Y, performing the same I2C probe at address 0x51 results in a timeout error instead of a successful response. The error message received is:
This timeout issue does not occur when using the old I2C driver, but it appears when using the new I2C driver.
Steps to reproduce.
There is no crash, but the I2C probe operation fails due to a timeout.
This issue does not occur when using STM32G070CBT Revision B, but it does occur with Revision Y when using the new I2C driver.
Debug Logs.
More Information.
The text was updated successfully, but these errors were encountered: