← index #11834Issue #1939
Off-topic · high · value 0.601
QUERY · ISSUE

esp32: Slow I2C on S2 after bus failures.

openby jimmoopened 2023-06-21updated 2024-09-02
bugport-esp32

After a certain number (usually <10) of failures (e.g. ENODEV due to non-existent address), the clock frequency seems to drop to 1/16 of the requested value.

Unfortunately, this is exactly how i2c.scan() is implemented, so the behavior I see is that everything is fine if I don't do a scan first.

i2c_get_period continues to report the original frequency. If add a call i2c_param_config to re-set the frequency, then all is fine.

Can replicate on IDF 4.4 and 5.0, and only on S2.

CANDIDATE · ISSUE

esp8266: the i2c freq argument is ignored

closedby deshipuopened 2016-03-27updated 2016-04-13
port-esp8266

The freq argument to machine.I2C doesn't seem to have any effect. No matter what value I pass to it, the resulting signal on the CLK line looks exactly the same on the osciloscope. Looking at the source code at https://github.com/micropython/micropython/blob/master/esp8266/modpybi2c.c#L84-L130 I can see that the "freq" variable is never used anywhere.

I tried to lower the frequency, because for some reason I'm getting occasional OSError when trying to write to the I2C bus, and, what's worse, those errors sometimes leave the device I'm communicating with in a stuck state.

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