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

RP2040 Feather Clock Stretch too long error with I2C Singleton #4372

Closed
makermelissa opened this issue Mar 9, 2021 · 6 comments · Fixed by #4390
Closed

RP2040 Feather Clock Stretch too long error with I2C Singleton #4372

makermelissa opened this issue Mar 9, 2021 · 6 comments · Fixed by #4390
Assignees
Labels
bug rp2 Raspberry Pi RP2 Micros
Milestone

Comments

@makermelissa
Copy link
Collaborator

makermelissa commented Mar 9, 2021

See https://forums.adafruit.com/viewtopic.php?f=60&t=176447&p=859863 for more details.

Using i2c = board.I2C() causes a "TimeoutError: Clock stretch too long" error but using
i2c = busio.I2C(board.SCL, board.SDA) fixes it.

@dhalbert
Copy link
Collaborator

dhalbert commented Mar 9, 2021

@makermelissa Are there other controllers that would be similar to the SSD1327, say like the SSD1306? I can order one but would like to test sooner?

@dhalbert dhalbert added this to the 6.2.0 milestone Mar 9, 2021
@makermelissa
Copy link
Collaborator Author

It seems to be getting caught on i2c = board.I2C(), so as long as something with pull-ups is attached via I2C, you should be able to reproduce the error. I would think the SSD1306 would be fine to test with.

@tannewt tannewt added the rp2 Raspberry Pi RP2 Micros label Mar 10, 2021
@ATMakersBill
Copy link
Collaborator

I think I am seeing this on the BNO055
I made a video https://www.youtube.com/watch?v=6dau3qSTxW8

@kevinjwalters
Copy link

kevinjwalters commented Mar 10, 2021

Are board.SCL and board.SDA defined on RP2040 / Pi Pico?

Adafruit CircuitPython 6.2.0-beta.3-11-g7970c882a on 2021-03-04; Raspberry Pi Pico with rp2040
>>> import board
>>> board.SCL
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'SCL'
>>> dir(board)
['__class__', 'A0', 'A1', 'A2', 'A3', 'GP0', 'GP1', 'GP10', 'GP11', 'GP12', 'GP13', 'GP14', 'GP15', 'GP16', 'GP17', 'GP18', 'GP19', 'GP2', 'GP20', 'GP21', 'GP22', 'GP25', 'GP26', 'GP26_A0', 'GP27', 'GP27_A1', 'GP28', 'GP28_A2', 'GP3', 'GP4', 'GP5', 'GP6', 'GP7', 'GP8', 'GP9', 'LED', 'SMPS_MODE', 'VOLTAGE_MONITOR']

Oh, I've worked this out, board must be different on the Feather. Ignore that!

@ATMakersBill
Copy link
Collaborator

For the record, adding the pins didn't fix the problem for me, but adding a long timeout seems to solve the "clock stretch" issue... still get "no pullups found" when I start up cold though
i2c = busio.I2C(board.SCL, board.SDA,frequency=40000,timeout=10000)

@SAK917
Copy link

SAK917 commented Mar 12, 2021

I am also getting this error using the Feather RP2040 with an SH1107 128x64 OLED Featherboard:

Adafruit CircuitPython 6.2.0-beta.3 on 2021-03-04; Adafruit Feather RP2040 with rp2040

import board
import displayio
displayio.release_displays()
i2c = board.I2C()

Traceback (most recent call last):
File "", line 1, in
TimeoutError: Clock stretch too long

I get the same result using the most recent CP build for the RP2040:
Adafruit CircuitPython 6.2.0-beta.3-125-g0e451a168 on 2021-03-11; Adafruit Feather RP2040 with rp2040

This code works on both a Feather M4 Express and a QT Py Haxpress when connected to the same display.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug rp2 Raspberry Pi RP2 Micros
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants