I2C bus_busy set on startup/reboot and no recovery option
Posted: Wed Sep 27, 2017 3:39 pm
Hi,
I have been fighting with a repeatable problem in the I2C subsystem that happens on startup and reboot. In a number of cases, the system will start with the I2C hardware state machine in an indeterminate state manifesting itself with the bus_busy flag of the i2c_dev_t structure already set prior to any I2C messages having been sent. This prevents all subsequent use of the I2C until a manual reset is performed. Even a soft reboot of the chip is insufficient to set the I2C state machine to a known starting state.
I have tried different methods to restart/reset the state machine such as:
- reconfiguring the I2C to operate in slave mode and then back into master mode
- running through the I2C startup steps again
- trying to change bus_busy flag to 0 manually
- trying to clear interrupt flag bits
- clearing the command buffer
- setting the done flag of the failed command in command buffer.
- adding clock toggle on the SCL line
Is there any known sequence of steps to get the subsystem into a known state or to restart via code?
Without a software solution, we will be forced to abandon the use of the module in production. It is working well in other respects and that would be unfortunate.
Thanks,
Jason
I have been fighting with a repeatable problem in the I2C subsystem that happens on startup and reboot. In a number of cases, the system will start with the I2C hardware state machine in an indeterminate state manifesting itself with the bus_busy flag of the i2c_dev_t structure already set prior to any I2C messages having been sent. This prevents all subsequent use of the I2C until a manual reset is performed. Even a soft reboot of the chip is insufficient to set the I2C state machine to a known starting state.
I have tried different methods to restart/reset the state machine such as:
- reconfiguring the I2C to operate in slave mode and then back into master mode
- running through the I2C startup steps again
- trying to change bus_busy flag to 0 manually
- trying to clear interrupt flag bits
- clearing the command buffer
- setting the done flag of the failed command in command buffer.
- adding clock toggle on the SCL line
Is there any known sequence of steps to get the subsystem into a known state or to restart via code?
Without a software solution, we will be forced to abandon the use of the module in production. It is working well in other respects and that would be unfortunate.
Thanks,
Jason