I2C Slave on ESP32-S3

Andre_Cilia
Posts: 4
Joined: Mon Mar 13, 2023 10:41 am

I2C Slave on ESP32-S3

Postby Andre_Cilia » Thu Aug 24, 2023 10:31 am

Hi,

I am designing a circuit which requires an I2C slave on an ESP32-S3.

I also have an I2C master port which is working perfectly well polling another device.

However the I2C slave port has this major problem, whereby a read request interrupt is serviced before the data received interrupt.
Therefore what happens is that the first read request returns nonsense data, the second read request returns the data loaded into the buffer by the first and so on.

I have attempted also to use the ESP-IDF functions using the default I2C interrupt routines for the I2C slave port alone, and also developed a quick code for Arduino-ESP framework - but the exact same issue comes up.

Could this indicate that this is some major issue with the I2C peripheral when it is in slave mode?

Is there any work arounds that can be done to resolve this issue?

Thanks!

marciogranzotto
Posts: 1
Joined: Tue Dec 05, 2023 6:05 pm

Re: I2C Slave on ESP32-S3

Postby marciogranzotto » Tue Dec 05, 2023 6:06 pm

Hey Andre,

could you solve your issue? I'm also trying to implement an I2C Slave on an ESP32-C6 that will spend most of its time in light sleep.

lukaro
Posts: 1
Joined: Thu Dec 26, 2024 6:26 pm

Re: I2C Slave on ESP32-S3

Postby lukaro » Thu Dec 26, 2024 6:28 pm

Hi,
I also need my esp32s3 in slave mode, did you came up with any solutions?

MicroController
Posts: 1999
Joined: Mon Oct 17, 2022 7:38 pm
Location: Europe, Germany

Re: I2C Slave on ESP32-S3

Postby MicroController » Fri Dec 27, 2024 1:57 pm

My understanding of the workings of the I2C slave (driver) is that you need to prepare all data you want and put it into the I2C's FIFO before the master issues a read. Then, when the master issues a read, the data present in the FIFO at that point is sent by the hardware without further software "intervention ".
You can also try to clear the FIFO first, which should yield an interrupt upon a read attempt.

Who is online

Users browsing this forum: ahsrabrifat, Bing [Bot] and 106 guests