How to increase I2C bus timeouts?

code4sex
Posts: 20
Joined: Tue Mar 16, 2021 12:23 pm

How to increase I2C bus timeouts?

Postby code4sex » Mon Nov 06, 2023 12:39 am

Hi,
Is there any way to configure a ESP32 I2C master driver so that it can handle long SCL-low periods?
The reason I want that is quite simple: my EPS32 master device sends a "start" command to a custom proximity sensor slave device (STM32) and waits for the response. The response might take up to a couple of seconds and the slave side can hold SCL low as long as required. However, this is far too long for basic read/write I2C driver functions as they all fail with a timeout error (0x107). The maximum I2C bus timeout set with i2c_set_timeout() is as miserable as 0.82 ms (16-bit value @ 80MHz).

Also, I made a couple of ugly attempts to try get round this issue:
(a) set up I2C_NUM_0 = master, I2C_NUM_1 = slave and let them share same SDA/SCL pins. No success.
(b) switched master/slave and slave/master in a loop. No success.

PS. I"m using IDF-5.0.1

Any suggestions :?:

Who is online

Users browsing this forum: No registered users and 104 guests