This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AWR1642: I2C driver I2CMaster_transfer timeout process

Part Number: AWR1642

Hi Team,

In I2C driver, I2CMaster_transfer function at C:\ti\mmwave_sdk_03_05_00_04\packages\ti\drivers\i2c\src\i2c_master.c

The code use the block mode and wait forever here to get the transferComplete signal. Is the wait forever have the risk? the comments said it will unblock on error. Can you please provide the error return reason and timeout process that can avoid block the core here. Thanks.

  /* Block until the transaction is complete. This will unblock on errors or sucessful completion */
SemaphoreP_pend(ptrI2CMCB->transferComplete, SemaphoreP_WAIT_FOREVER);

Please let me know if you have any further questions.

Thanks.

Wesley

  • Hi Wesley,

    Just to clarify, I2CMaster_transfer will not block the core, just the task calling it. Other tasks can run on the core while the calling task waits on the I2C transfer to complete/return an error. You can put a timeout value here, but I don't see a need to do this as in blocking mode, it is logical for the function to only return once the transfer is complete, or if there is an error.

    Can I ask why it would be an issue to use the blocking I2C call?

    Regards,

    Aayush

  • Hi Aayush,

    Customer have concern on the block the code there. So they change it to timeout mode.

    Thanks.