I'm trying to make more use of MCUX SDK functions as I port projects from the unavailable MK22FN1M0 to the LPC55S69, and one issue I've run into is that the FreeRTOS-aware I2C driver provided (fsl_i2c_freertos.c) doesn't provide any timeout mechanism for I2C transfers.
When you call I2C_RTOS_Transfer(), it always blocks indefinitely as it waits for the transfer to complete. If the transfer fails it just hangs forever. For my purposes I've worked around it for now by hard-coding a timeout in the driver, but I haven't dug into it enough to see if that's leaving the rest of the driver in an inconsistent state. In this case it doesn't matter because a failed transfer during initialization means a failed sensor and the application will flag it as bad, throw a warning, and exclude the sensor.
Assuming there's not some other timeout mechanism I'm not seeing, it'd be very useful to have a proper timeout option. Without one, there's no way to probe for peripherals that might or might not be present, or to handle failures. Is this the appropriate place to make a feature request?
Thanks,
Scott
Hi @scottm
Thanks very much for your input, let me create an internal ticket for this.
Regards
Daniel