No timeout option in MCUX SDK FreeRTOS I2C driver

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

No timeout option in MCUX SDK FreeRTOS I2C driver

1,483 Views
scottm
Senior Contributor II

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

0 Kudos
Reply
4 Replies

1,425 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi @scottm 

 

Thanks very much for your input,  let me create an internal ticket for this.

 

Regards

Daniel

0 Kudos
Reply

640 Views
alansmith
Contributor I

@danielchendid anything ever come of this ticket? I am running into the same issue and needed to modify the driver to include a timeout. Was wondering if there is a better workaround.

0 Kudos
Reply

612 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi @alansmith :

 I checked this ticket  that I raised before,  currently it is not in the todo list.  Sorry.

 

Regards

Daniel

0 Kudos
Reply

625 Views
scottm
Senior Contributor II

I had to add my own timeout. I haven't seen a change in the SDK but then I haven't been looking closely in a while.

0 Kudos
Reply