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.

RTOS/AMIC110: I2C hang issue

Part Number: AMIC110

Tool/software: TI-RTOS

Hi,

I got the problem, that when I connect and disconnect an I2C temperature sensor, it is able to hang the whole processor.

In the functin  I2C_primeTransfer_v1() there are several while{} loops, which are just blocking the processor, until the bus is free. BUT!!!! By connecting and disconnecting the sensor it can make the bus permanently busy! So it is necessary to reset the bus and start again!

So I wanted to overwrite the function "I2CMasterBusBusy", which is called in the while loops to get rid of the problem. But how to overwrite the function from the lib? Everything I found in the internet didn't work for ti compiler.

Or is there an easy way to rebuild the csl library?

I is really urgent. Because of that we failed an EMC Test and the product needs to be delivered really soon.

  • The RTOS team have been notified. They will respond here.
  • Stefan,

    Are you enabling timeout using i2cTransaction.timeout = I2C_TRANSACTION_TIMEOUT;. There is a sequence for I2C bus recovery documented in eeprom test
    ti\drv\i2c\example\eeprom_read\src\main_eeprom_read_recovery.c
    Function : i2c_test

    In addition to the SW mechanism by using I2C _control to recover from the Bus Hang condition, there are additional recommendation to recover from hang condition from an SOC perspective that are discussed in the article here:
    processors.wiki.ti.com/.../I2C_Tips

    A popular work around that OMAPL13x users have confirmed to work is to change the pinmux for the SCL pin to GPIO and toggle it until the slave releases SDA line. I checked that AMIC110/AM335x I2C pins can be muxed to GPIO so the solution also applies to AM335x.

    The easiest way to build CSL library is from the PDK packages level using the following command:
    cd pdk_am335x_1_0_10\packages
    pdksetupenv.bat
    gmake csl

    Does this not work for you?

    Regards,
    Rahul
  • I just added now some lines to the while loops, so that after a defined time, that the bus is not free, it just continues. And this seems to work for me. I can post the work around tomorrow.

    I didn't find the commad for building it. I will try it as well tomorrow.
  • I found another while loop, where the I2C driver hangs.
    It's a pitty, that this was not tested by TI before.

    Thank you for the hint with the gpio. After I found all while loops, which made problems, I had the problem with the slave as well and could solve it with toggling the gpios.