Modular Switch Board Features:-
The ESP32-S3 acts as a master module to drive the slave slots.
Slave slots can be plugged into the switchboard frame.
The master and slave communicate over the I2C bus.
The master controls the I2C slave slots by sending commands over I2C frames.
The master always remains powered on.
Both the master and slaves are powered by a common 3.3V supply.
Slaves are mobile and can be plugged in or unplugged from the slots.
Commands are sent to the master via a BLE app when a slave is inserted into a slot to initiate communication over I2C.
Problem Statement:-
Sometimes, a slave gets stuck on the I2C line.
The slave holds the I2C line low, causing clock stretching.
The master becomes unable to communicate, even after being reset using a dedicated reset button.
I have a screenshot from a logic analyzer showing that my first slave successfully commissioned and received the address 0x60(slave address). However, when I add a second slave(second slave address 0x01), the first slave starts holding the SCL line low. It reaches the 0x5F address, then 0x60, so I think the slave is holding the SCL line.
Currently , the code is only working when we reset that particular stucked slave controller which is not at all efficient solution.
Required Solution:-
A method to unbrick the I2C line by reinitializing I2C on the master side.
Alternative solutions to recover a stuck I2C line without requiring a hardware reset or power cycling.
Any help would be appreciated
ESP32-S3 I2C Recovery: Unstuck Slave Holding SCL Low & Reinit I2C Without Reset
-
milan pipaliya
- Posts: 21
- Joined: Fri Oct 11, 2024 4:14 am
ESP32-S3 I2C Recovery: Unstuck Slave Holding SCL Low & Reinit I2C Without Reset
- Attachments
-
- i tried this clock recovery snippet
- Screenshot from 2025-03-06 15-41-54.png (62.02 KiB) Viewed 836 times
-
- Screenshot from 2025-03-05 13-05-05.png (29.76 KiB) Viewed 836 times
Re: ESP32-S3 I2C Recovery: Unstuck Slave Holding SCL Low & Reinit I2C Without Reset
What chips do you use as slaves?Sometimes, a slave gets stuck on the I2C line.
The slave holds the I2C line low, causing clock stretching.
The master becomes unable to communicate, even after being reset using a dedicated reset button.
[...]
A method to unbrick the I2C line by reinitializing I2C on the master side.
Alternative solutions to recover a stuck I2C line without requiring a hardware reset or power cycling.
In general, I'm not sure if there's a way to get out of that situation if you only control the master. With the SCL line stuck low, there is no way the master can generate a start or stop condition or send any data.
-
milan pipaliya
- Posts: 21
- Joined: Fri Oct 11, 2024 4:14 am
Re: ESP32-S3 I2C Recovery: Unstuck Slave Holding SCL Low & Reinit I2C Without Reset
The slave controller is STM32G031K8 from STM . The first slave is working just fine with the master , but when second slave is plugged the first slave is pulling the SCL line low and is not releasing it even on resetting the master controller . Only after resetting the first slave , the SCL line is released , but this is not at all an efficient solution .
Re: ESP32-S3 I2C Recovery: Unstuck Slave Holding SCL Low & Reinit I2C Without Reset
Sounds like you're better off searching for a solution on the STM32G031K8 side of things, then.
Who is online
Users browsing this forum: ChatGPT-User, Google [Bot], Qwantbot and 1 guest
