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.

Linux/TDA2EVM5777: TDA2xx EVM 5777

Part Number: TDA2EVM5777

Tool/software: Linux

Hi,

I want to use i2c bus on linux on the TDA2xx EVM 5777

I am trying out the i2cdetect utility.

the i2cdetect shows 2 busses, 0, and 2.

However, when i run i2cdetect 0 , it does not show any devices on the bus.

Also, tried to us i2cdump to dump the EEPROM data, it does not show valid data.

Pls. advise.

Thanks and Regards,

Archit Adwant

----------------------------------------------------------------------------------------------------------------

root@dra7xx-evm:/usr/bin# i2cdetect -l
i2c-0 i2c OMAP I2C adapter I2C adapter
i2c-2 i2c OMAP I2C adapter I2C adapter
root@dra7xx-evm:/usr/bin# i2cdetect 0
i2cdetect: warning: can't use SMBus quick write command, will skip some addresses
i2cdetect: WARNING! This program can confuse your I2C bus
Continue? [y/N] y
0 1 2 3 4 5 6 7 8 9 a b c d e f
00:
10:
20:
30:
40:
50:
60:

----------------------------------------------------------------------------------------------------------------

  • Try running following

    i2cdetect -y -r <busnum>
    i2cdump -f -y <busnum> <chip_addr>

    Nikhil D
  • Thanks Nikhil,

    The i2cdetect -y r 0 worked.
    But i get the GPIO expander as busy.
    The i2cdump -f -y 0 0x50 returns 0xff. It should return EEPROM data.
    Also, unable to set the user LEDs on the TI TDA2xx EVM 5777
    Log below.
    Pls advise.
    Is there any reference for i2c on this EVM?

    Thanks and Regards,

    Archit Adwant

    ------------------------------------------------------------------
    root@dra7xx-evm:~# i2cdetect -y -r 0
    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: -- -- -- -- -- -- -- -- -- -- -- -- --
    10: -- -- -- -- -- -- -- -- -- UU -- -- -- -- -- --
    20: UU UU -- -- -- -- -- -- -- -- -- -- -- -- -- --
    30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- --
    50: 50 -- -- -- -- -- -- -- UU UU UU 5b -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --
    root@dra7xx-evm:~# i2cdump -f y 0 0x50
    i2cdump: invalid number 'y'
    root@dra7xx-evm:~# i2cdump -f -y 0 0x50
    0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
    00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    10: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    20: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    40: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    a0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
    root@dra7xx-evm:~# i2cset -y 0 0x20 0x0f0
    i2cset: can't set set address to 0x20: Device or resource busy
    ------------------------------------------------------------------
  • You have to use i2cset -f flag to force the writes.
    Here is a fun_leds.sh script I use to test the USER LEDs on the DRA7xx EVMs


    ==================================================================
    #Help
    #i2cset -f -y <bus number> <chip number> <data bytes>
    #For simple devices (SMBus), data bytes would be two bytes for write operation
    #So, <data bytes> = <addr byte> <value byte>

    mask=$((0xf))
    set_led() {
    num=$1
    mask=$(($mask & ~(0x1 << $num)))
    }

    unset_led() {
    num=$1
    mask=$(($mask | 0x1 << $num))
    }

    i2c_cmd() {
    val=$(($mask << 4))
    val=$(($val | 0xf))
    val=`printf 0x%x $val`
    i2cset -f -y 0 0x20 $val 0xff
    }

    i2c_cmd
    for i in `seq 0 3`
    do
    set_led $i
    i2c_cmd
    msleep 500
    unset_led $i
    done
    i2c_cmd
    ==================================================================


    Most likely you are getting the 0xff from the EEPROM because the device is not responding correctly.
    You can confirm this by explicitly doing an i2cget -f -y 0 0x50 0x0
    If you get failure, then the device is not responding.

    Its possible that its missing the power or enable signal.


    Regards,
    Nikhil D
  • Thanks.
    The -f option worked and Could toggle the LEDs.
    The EEPROM read is working for the first byte only somehow. Unable to read the remaining bytes
    i think 2cset needs a 16 bit word i think. It failed with only 8 bit byte.

    Thanks and Regards,
    Archit Adwant