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.

MCU-PLUS-SDK-AM263X: I2C HLD timeout

Part Number: MCU-PLUS-SDK-AM263X
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

I'm often receiving a timeout error reading from I2C using SDK 10.00.00.35 configured without interrupt from sysconfig (no issue with SDK 9.00). The error is identified as a timeout (return code is -2) even if it seems to appen immediatly (I used 400 as timeout parameter).  What is the unit of the timeout parameter? Why I'm receiving this error using SDK10 while no error was present on SDK 9?

  • Hi Alessandro,

    Apologies for the delayed response.

    Can you please send me screenshot of the error?
    I am on it, will come back ASAP.

    Regards,
    Narayanarao Puli

  • This is the part of the code where we have the error.

    The return code (status variable in my code) I received is -2.

    The documentation doesn't mention the unit of the timeout parameter.

    My assumption is that the timeout that, with older SDK was in milliseconds, now is in microseconds.

    Is my assumption correct?

    Regards

    Alessandro

  • My assumption is that the timeout that, with older SDK was in milliseconds, now is in microseconds.

    Is my assumption correct?

    Yes, the timeout parameter is in microseconds in SDK 10 version.

    I am able to run with 400KHz clock (which can be configurable from sysconfig), timeout value of 400 and I2C read length of 1Byte.

    It might be the timeout value that is causing the error in your project, depends on the frequency and read count(I2C_READ_LEN) timeout value will vary.

    In your case, it worked in SDK9.0 because the timeout is in milli seconds, that much time was enough to complete the transaction so there was no timeout error. But in SDK10.0, timeout is in microseconds and 400 microseconds may not be sufficient for the transaction. Please calculate the approximate timeout value based on the frequency and read count that you are putting.

    Please share the read count and frequency that you are configuring. We will try with them.

    Regards,

    Narayanarao Puli

  • So the problem was just due to the undocumented change in the order of magnitude of the unit of measurement of the timeout parameter.

  • Apologies for that.

    For your Information, the parameter details are captured in a header file called i2c_lld.h in which all the functions and variables are defined. 

    Regards,

    Narayanarao Puli