micropython / micropython/micropython

RP2: Hard I2C not working

Open
#15,120 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug port-rp2
Dominant language
C
Stars
22.1k
Forks
9k
Avg merge
6d 4h
Merged PRs (30d)
16

Description

Checks
  • I agree to follow the MicroPython Code of Conduct to ensure a safe and respectful space for everyone.

  • I've searched for existing issues matching this bug, and didn't find any.

Port, board and/or hardware

rp2

MicroPython version

MicroPython v1.22.2

Reproduction

from machine import Pin, I2C
from ssd1306 import SSD1306_I2C
bus = I2C(id = 0, scl = Pin(9), sda = Pin(8), freq = 100_000)
display = SSD1306_I2C(128, 64, bus)

Expected behaviour

ssd1306 working

Observed behaviour

Failure with errors EIO / ETIMEDOUT.

Tested with id 0 and 1, on different pins.
Works like a charm using SoftI2C.

Additional Information

Could be related to this ticket ?
RP2: Hard I2C is intolerant of clock stretching
https://github.com/micropython/micropython/issues/8167

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the supplied SSD1306_I2C example on RP2 hardware, comparing hard I2C with SoftI2C and the reported EIO or ETIMEDOUT failures. Read the linked issue #8167 for related clock-stretching context; done means the hard-I2C example works reliably on the tested bus IDs and pins.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.