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.

TM4C1294NCPDT: TI RTOS TivaC I2C driver - How application can report master error?

Part Number: TM4C1294NCPDT

Dear SupportTeam,

If I2C transfer is failed due to errors such as NACK, Bus arbitration loss etc; how would application come to know the exact reason. I am using I2C in call back mode

In the hwi function, there is a call to I2CMasterIntClear()  so as per my understanding, it will clear all master errors and corresponding bits in MRIS and MMIS registers will also get cleared. By the time application gets control, all I2C errors would be cleared.

Thanks you.

Regards

Abhijit

  • Hello Abhijit,

    Sorry for the delay on this. We had a US holiday on Monday and this topic was too complicated to look into during it. I had to spend some time trying to dig through the TI-RTOS documentation and code to see better how they implemented this.

    I don't see an explicit passing of the error code to the application, but the user seems to be given information.

    It looks like an error log is generated with the error status:

            Log_print2(Diags_USER1,
                       "I2C:(%p) ISR I2C Bus fault (Status Reg: 0x%x)",
                       hwAttrs->baseAddr,
                       errStatus);

    I'm not really versed in how you then turn around and use that for application code, but the logging mechanism is part of the XDC runtime module of the RTOS kernel. You can review the documentation here: file:///C:/ti/tirtos_tivac_2_16_00_08/products/bios_6_45_01_29/docs/cdoc/xdc/runtime/Log.html

    Unfortunately my knowledge ended with the TM4C hardware and the kernel elements are just areas I have limited knowledge of.

    Best Regards,

    Ralph Jacobi

  • Hello Ralph,

    Thank you for your response.

    We have different logging mechanism therefore can we can't use the one provided by RTOS.

    Thanks & Regards

    Abhijit