nxp-mcuxpresso / mcux-sdk

MCUXpresso SDK
BSD 3-Clause "New" or "Revised" License
320 stars 139 forks source link

[BUG] CMSIS I2C Driver Stuck Busy #201

Open tefry opened 1 month ago

tefry commented 1 month ago

Describe the bug When a transmit is attempted with fsl_i2c_cmsis.c I2C_Master_InterruptTransmit and the I2C bus is busy for reasons other than the master has not initiated a transaction, the master_handle.state gets stuck in busy without any way to recover. Calls to try to abort the transfer via I2C_InterruptControl are not successful because the check for being a Master transfer fails. Any subsequent transmit also returns busy due to only checking the master_handle.state and never going any lower to check if the bus is still busy.

To Reproduce

Expected behavior The expectation is that if something happens that causes the I2C to become busy, that an abort or at the very least reinitializing the driver via PowerControl(ARM_POWER_OFF), Uninitialize, Initialize, and PowerControl(ARM_POWER_FULL) should reset the state of the driver to not busy (idle).

mcuxsusan commented 1 month ago

Thanks for the feedback, did you still see the issue in our latest version of SDK? Already sent the issue to development, the feedback could be delayed, appreciate for your patience.