I2C BUS Error

balabhaskar.vg
Posts: 5
Joined: Thu Aug 07, 2025 7:37 am

I2C BUS Error

Postby balabhaskar.vg » Thu Aug 07, 2025 8:25 am

Hi Sir
In my project I am using ESP32-S3-MINI-1U-N8 as the main controller unit, It has 4 slaves in its I2C
1)EEPROM
2) Fuel Gauge
3)MPPT Charger
4) GPIO Expander
The LT8491 is battery charger IC whose input is from solar panel. When I probe the I2C SCL line of the MPPT charger LT8491 we found out that the I2C bus line its coming down from 3.3V to 2.2V when it is in IDLE condition that is not powered from solar panel and in the IC's datasheet its has been specified that the Master (ESP-32-S3-MINI-N8) has to support Clock Stretching for effective communication. Is there any way to enable this feature in ESP32S3miniN8. Also could you explain the attached image section specified in the technical manual and suggest a solution for this.
Attachments
I2C Clock stretching.png
Technical Reference manual
I2C Clock stretching.png (183.48 KiB) Viewed 1160 times

Sprite
Espressif staff
Espressif staff
Posts: 10599
Joined: Thu Nov 26, 2015 4:08 am

Re: I2C BUS Error

Postby Sprite » Fri Aug 08, 2025 9:16 am

The LT8491 is battery charger IC whose input is from solar panel. When I probe the I2C SCL line of the MPPT charger LT8491 we found out that the I2C bus line its coming down from 3.3V to 2.2V when it is in IDLE condition that is not powered from solar panel
Sounds like the LT8491 is only using the solar panel as the power source, and effectively takes down the I2C bus when that doesn't provide enough power (probably because of internal ESD diodes conducting the I2C lines to a sagging power rails). Are you sure that chips EXTVCC is connected to something (e.g. the battery) that delivers more than 6.25V?
and in the IC's datasheet its has been specified that the Master (ESP-32-S3-MINI-N8) has to support Clock Stretching for effective communication. Is there any way to enable this feature in ESP32S3miniN8.
The ESP32S3 supports clock stretching out of the box, no need to enable it.
Also could you explain the attached image section specified in the technical manual and suggest a solution for this.
That applies to I2C slave mode and not to your situation as you're using the ESP32 as an I2C master.

balabhaskar.vg
Posts: 5
Joined: Thu Aug 07, 2025 7:37 am

Re: I2C BUS Error

Postby balabhaskar.vg » Fri Aug 08, 2025 2:18 pm

Thanks, Sprite,
For your support,
Is there any way we can enable clock stretching in the master mode.
"Sounds like the LT8491 is only using the solar panel as the power source, and effectively takes down the I2C bus when that doesn't provide enough power (probably because of internal ESD diodes conducting the I2C lines to a sagging power rails). Are you sure that chips EXTVCC is connected to something (e.g. the battery) that delivers more than 6.25V?"
Yes LT8491 is only powered from solar panel, we have tried that but could not get it to work.
The ESP32S3 supports clock stretching out of the box, no need to enable it.
Could you please explain this ?
With regards
Balabhaskar V G

Sprite
Espressif staff
Espressif staff
Posts: 10599
Joined: Thu Nov 26, 2015 4:08 am

Re: I2C BUS Error

Postby Sprite » Sat Aug 09, 2025 12:28 am

The ESP32S3 supports clock stretching out of the box, no need to enable it.
Could you please explain this ?
The ESP32S3 always has support for clock stretching enabled.
"Sounds like the LT8491 is only using the solar panel as the power source, and effectively takes down the I2C bus when that doesn't provide enough power (probably because of internal ESD diodes conducting the I2C lines to a sagging power rails). Are you sure that chips EXTVCC is connected to something (e.g. the battery) that delivers more than 6.25V?"
Yes LT8491 is only powered from solar panel, we have tried that but could not get it to work.
Then that is your problem. The LT8491 is getting starved for power, and tries to draw current from your I2C lines to stay alive; unsurprisingly, an I2C bus doesn't really like chips using it as a power supply so the entire bus collapses. You need to make sure your LT8491 stays powered; that is the core of your problem.

balabhaskar.vg
Posts: 5
Joined: Thu Aug 07, 2025 7:37 am

Re: I2C BUS Error

Postby balabhaskar.vg » Mon Aug 11, 2025 5:09 am

Hi Sir,
The ESP32S3 always has support for clock stretching enabled.
Is it applicable for ESP32S3 acting as master also.
Then that is your problem. The LT8491 is getting starved for power, and tries to draw current from your I2C lines to stay alive; unsurprisingly, an I2C bus doesn't really like chips using it as a power supply so the entire bus collapses. You need to make sure your LT8491 stays powered; that is the core of your problem.
Thank you sir for your suggestion I will check with the team.

balabhaskar.vg
Posts: 5
Joined: Thu Aug 07, 2025 7:37 am

Re: I2C BUS Error

Postby balabhaskar.vg » Thu Aug 14, 2025 6:36 am

Hi Sprite,

We have observed that the previously mentioned I²C bus issue also occurs when the MPPT charger (LT8491) is powered and it is continuously occurring but rather randomly . Could you please confirm whether the ESP32, when operating as the master, supports I²C clock stretching?

Thanks and regards,
Balabhaskar V G

eriksl
Posts: 199
Joined: Thu Dec 14, 2023 3:23 pm
Location: Netherlands

Re: I2C BUS Error

Postby eriksl » Thu Aug 14, 2025 2:06 pm

Interesting. Although I2C is not designed for hotplugging, it is possible to have slave attached that don't receiver power. These slaves will just "NAK" everything, just like they weren't there anyway.

For this to work, you need to have the pull up resistors always powered (e.g. by the ESP32). You also need to make sure your device doesn't try to take it's power supply from the SCL and SDA lines. IC's often have input pin protection diodes, one from the pin to Vcc and one from Vss to the pin. This protection diode will make the IC draw current from the SCL and SDA lines. If your IC has them, you will need to work this around. One way that comes to mind is to use a MOSFET in both SCL and SDA lines, controlled by the power supply of your troublesome IC. If it's power goes away, it will also isolate the IC from the bus. AFAIK there are also IC's that can isolate I2C buses, may they're more robust. A common I2C bus multiplexer won't help here I fear.

eriksl
Posts: 199
Joined: Thu Dec 14, 2023 3:23 pm
Location: Netherlands

Re: I2C BUS Error

Postby eriksl » Thu Aug 14, 2025 2:07 pm

Interesting. Although I2C is not designed for hotplugging, it is possible to have slave attached that don't receiver power. These slaves will just "NAK" everything, just like they weren't there anyway.

For this to work, you need to have the pull up resistors always powered (e.g. by the ESP32). You also need to make sure your device doesn't try to take it's power supply from the SCL and SDA lines. IC's often have input pin protection diodes, one from the pin to Vcc and one from Vss to the pin. This protection diode will make the IC draw current from the SCL and SDA lines. If your IC has them, you will need to work this around. One way that comes to mind is to use a MOSFET in both SCL and SDA lines, controlled by the power supply of your troublesome IC. If it's power goes away, it will also isolate the IC from the bus. AFAIK there are also IC's that can isolate I2C buses, may they're more robust. A common I2C bus multiplexer won't help here I fear.

balabhaskar.vg
Posts: 5
Joined: Thu Aug 07, 2025 7:37 am

Re: I2C BUS Error

Postby balabhaskar.vg » Tue Aug 19, 2025 6:38 am

Hi,
Thank you for suggestion,
We will consider it and let you know further updates.
Alternatively , does ESP32-S3 mini supports clock stretching, when it is acting as master ?

eriksl
Posts: 199
Joined: Thu Dec 14, 2023 3:23 pm
Location: Netherlands

Re: I2C BUS Error

Postby eriksl » Sun Sep 14, 2025 8:02 am

AFAIK clock stretching is supported. But it's a discouraged practice.

Who is online

Users browsing this forum: Google [Bot], Qwantbot and 4 guests