-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 problems on ESP32-S2 after scan #9561
Comments
Could you re-test with 9.2.0-beta.0? Thanks. I am not seeing an issue now. But I don't have an SSD1306 connected, just a seesaw board. |
I tested with an SSD1306 breakout. Interestingly, I have a very simple reproducer, on ESP32-S2 only, with 9.2.0-beta.0:
produces:
There is no error on ESP32-S3 or RP2040. |
I looked at this with a Saleae. On ESP32-S2, the I2C bus frequency is only 1.25 kHz (!), even though I requested 100 kHz. This is apparently due to some bug in ESP-IDF v5.3.1 (used in CircuitPython 9.2.0), which switched things around under the covers for the legacy I2C driver. It's fine in ESP-IDF v5.2.2, which is used in CircuitPython 9.1.4. I reproduced the problem with an ESP-IDF-supplied example and opened an ESP-IDF issue: We want to move to the new ESP-IDF I2C driver, and that's possible now that esp-camera has updated. However, there are several open I2C issues for the new driver, so I'm not sure we want to move ahead yet if it may introduce new problems. |
Thank you @dhalbert for wrangling this issue. I updated to 9.2.0-beta.0 and retried my code with original h/w (QTPY-ESP32-S2, adafruit_ssd1306, adafruit_seesaw (rotaryio, #4991) Result: Now fails even when I don't do a i2c.scan() -- this succeeded with v9.1.1
Also tried I2C freq 40_000 and 10_000, no joy. |
@tannewt started a branch with an update to the new ESP-IDF driver for I2C: https://github.com/tannewt/circuitpython/tree/idf5.2_i2c. I'm continuing with that on |
I've fixed these crashes. Should have a PR after I convert |
Quoting from #9535 (comment):
I'm having a very similar issue with I2C on QT-PY-ESP32-S2. I've come at it all kinds of ways, with one or multiple I2C devices and varying the I2C bus speed from 10_000 to 400_000.
With these i2c devices:
When I do a i2c.scan() it never shows any devices, but I can "speak" to the rotaryio. When I enable the ssd1306, I get:
If I never do the i2c.scan(), seesaw-rotaryio and ssd1306 appear to work fine (I've tried different instances of ssd1306 hardware).
In the case where I use only the seesaw-rotaryio and do i2c.scan(), the scan still shows no devices, I can communicate with the seesaw-rotario and my code speed decreases dramatically, e.g. 100+ loops/second becomes ~15 loops/second.
Code below. Can anyone shed some light on this?
Thanks,
Casa
Originally posted by @Casa-Machinalia in #9535 (comment)
The text was updated successfully, but these errors were encountered: