I2C Busy Timeout and wedged I2C Bus
Posted: Wed Aug 15, 2018 11:59 pm
Hi, We have a custom board w/ ESP32-WROOM module that uses a I2C to read various signals through a MCP23017 GPIO expansion module. A task reads these pins every minute for various control functions. We have noticed, perhaps since upgrading to IDF 3.0.2, that occasionally the I2C gets wedged and we get a stream of "Busy Timeout!" log messages, which, based upon the code in esp32-has-i2c.c, occurs upon write when the i2c status register indicates that the bus is busy:
In fact, scoping shows that in this state, the clock and data lines are running continuously - it's wedged.
It is quite difficult to reproduce the problem - I have had some success w/ test software that reads these bits very rapidly while other tasks perform mqtt transmissions and modbus reads.
I have put in some bandaid detection software that resets the line when this happens, so we're limping along, but I'm curious if anyone has experience with this, or any advice on what could be causing it.
Thanks
Code: Select all
if (i2c->dev->status_reg.bus_busy == 1)
{
log_e( "Busy Timeout! Addr: %x", address >> 1 );
I2C_MUTEX_UNLOCK();
return I2C_ERROR_BUSY;
}
It is quite difficult to reproduce the problem - I have had some success w/ test software that reads these bits very rapidly while other tasks perform mqtt transmissions and modbus reads.
I have put in some bandaid detection software that resets the line when this happens, so we're limping along, but I'm curious if anyone has experience with this, or any advice on what could be causing it.
Thanks