← index #18668Issue #18353
Related · high · value 3.721
QUERY · ISSUE

Hardware I2C doesn't work on ESP32-C5

openby sfe-SparkFroopened 2026-01-09updated 2026-03-16
bugport-esp32

Port, board and/or hardware

esp32 port, ESP32-C5-DevKitC-1 v1.2

MicroPython version

MicroPython v1.27.0 on 2025-12-09; ESP32C5 module with ESP32C5

Reproduction

import machine
i2c0 = machine.I2C(id=0)
i2c1 = machine.I2C(id=1)
i2c0.scan()
i2c1.scan()

Expected behaviour

i2c0 and i2c1 should be created with no errors, and both should be able to scan and perform read/write operations.

Observed behaviour

Attempting to create i2c0 causes a reboot:

MicroPython v1.27.0 on 2025-12-09; ESP32C5 module with ESP32C5
Type "help()" for more information.
>>> import machine
>>> i2c0 = machine.I2C(id=0)
ESP-ROM:esp32c5-eco2-20250121
Build:Jan 21 2025
rst:0x1a (CPU_LOCKUP),boot:0x5b (SPI_FAST_FLASH_BOOT)
Core0 Saved PC:0x4200757e
SPI mode:DIO, clock div:1
load:0x408556b0,len:0xdfc
load:0x4084bba0,len:0xc4c
load:0x4084e5a0,len:0x2ee8
entry 0x4084bba0
MicroPython v1.27.0 on 2025-12-09; ESP32C5 module with ESP32C5
Type "help()" for more information.
>>> 

Attempting to create i2c1 results in error messages. The I2C scan (and read/write methods) complains that the driver is not installed:

MicroPython v1.27.0 on 2025-12-09; ESP32C5 module with ESP32C5
Type "help()" for more information.
>>> import machine
>>> i2c1 = machine.I2C(id=1)
E (22747) i2c: i2c_driver_install(305): LP_I2C is not supported via i2c_driver_intall()
>>> i2c1 = machine.I2C(id=1)
E (24887) i2c: i2c_driver_delete(484): i2c driver install error
E (24887) i2c: i2c_driver_install(305): LP_I2C is not supported via i2c_driver_intall()
>>> i2c1.scan()
E (29467) i2c: i2c_master_cmd_begin(1552): i2c driver not installed
E (29467) i2c: i2c_master_cmd_begin(1552): i2c driver not installed
E (29467) i2c: i2c_master_cmd_begin(1552): i2c driver not installed
...
E (30107) i2c: i2c_master_cmd_begin(1552): i2c driver not installed
E (30107) i2c: i2c_master_cmd_begin(1552): i2c driver not installed
E (30117) i2c: i2c_master_cmd_begin(1552): i2c driver not installed
[]
>>>

Additional Information

I also noticed i2c1 (which is presumably the LP I2C peripheral) uses scl=9, sda=8:

>>> i2c1
I2C(1, scl=9, sda=8, freq=400000, timeout=50000)

However LP I2C on the ESP32-C5 can only be used on pins 2 and 3 (see the ESP32-C5 datasheet, section 4.2.1.3, "Pin Assignment").

FWIW SoftI2C() seems to work fine.

Code of Conduct

Yes, I agree

CANDIDATE · ISSUE

conflict with i2c driver

closedby uraichopened 2025-10-31updated 2025-11-03

Port, board and/or hardware

esp32s3

MicroPython version

Latest master

Reproduction

Building works ok but MicroPython does not boot.
I get an error saying:
E (571) u2c: CONFLICT! driver_ng is not allowed to be used with this old driver

Expected behaviour

Expected the MicroPython prompt

Observed behaviour

See above

Additional Information

The ESP32 version (not S3) works fine.

Code of Conduct

Yes, I agree

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied