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/TDA2PXEVM: vision sdk I2C read fail

Part Number: TDA2PXEVM

Tool/software: TI-RTOS

hi all,

our board is DRA76XP, SOC is TDA2PX, we use adv7182 as capture video decoder, i already add adv7182 driver in "ti_components\drivers\pdk_01_10_00_08\packages\ti\drv\vps\src\devices"

adv7182 use I2C instance 3 to communicate with SOC. Before access to adv7182 register i already power up this ship. but when i read this ship ID by read it's register I2C read fail!!

I2C instance 3,  adv7182 I2C write address is 0x40,  read address is 0x41, so the device I2C address is  0x20 = 0x40 >> 1;

log as following:

 [HOST] [IPU2  ]     26.813517 s: Bsp_adv7182GetChipId() be Called!!!!
 [HOST] [IPU2  ]     26.813639 s: Bsp_adv7182I2cRead8() be Called, I2C-3, addr = 0x20!!!!
 [HOST] [IPU2  ]     31.814737 s: src/bsp_deviceI2c.c @ Line 350:
 [HOST] [IPU2  ]     31.814860 s:  I2C3: DEV 0x20: RD 0x11 ... ERROR !!!
 [HOST] [IPU2  ]     31.815012 s: src/bsp_deviceI2c.c @ Line 416:
 [HOST] [IPU2  ]     31.815104 s:  I2C3: Error timeout 5001 ms!!!
 [HOST] [IPU2  ]     31.815226 s: adv7182/src/bspdrv_adv7182I2c.c @ Line 899:
 [HOST] [IPU2  ]     31.815317 s: I2C read failed
 [HOST] [IPU2  ]     31.815378 s:  Assertion @ Line: 218 in /home/abc/vision_sdk/apps/src/rtos/video_sensor/src/adv7182/video_decdr.c: retVal == 0 : failed !!!

and i call Bsp_deviceI2cProbeAll() function to dectect I2C instance3 bus:

 [HOST] [IPU2  ]     22.876288 s: I2C3: Passed for address 0x2c !!!
 [HOST] [IPU2  ]     23.015951 s: I2C4: Passed for address 0xe !!!
 [HOST] [IPU2  ]     23.059659 s: I2C4: Passed for address 0x2c !!!

from the log 0x20 address is not detect on I2C instance 3 bus, i have check the adv7182 chip power pin, all setting is already.

can anyone help me figure out the investigation direction, so i can find out the problem?

what's more,  as A15 and M4 can not use same I2C instance, so i disable I2C instance 3 on A15 size by add "DISABLE_COMPLETE(i2c4)" in dra76x-evm.dts.

best regards!!!

  • Hi,

    Can you check the ADV7182 data sheet, if this requires any power on sequence before you can access through the I2C interface?
    On what i2c pins of device the adv chip is connected? have you done the corresponding pinmux?

    You also need check the I2C instance numbers used for the configuration.
    Driver starts i2c instance numbering from 0 but the naming in TRM starts from 1.

    Regards,
    Prasad
  • hi Prasad,

    thanks for your reply, i had check the adv7182 data sheet carefully, the power sequence as following:

    and i have use voltmeter to measure the voltage of PWRDWN and RESET pin, both of them are high level.

    and adv7182 chip I2C is connected to SDA4 and SCL4, the index is start from 1, so i think in vision SDK it is relate to the I2C instance 3.

    i also check the MCASP4 ACLKX and FSX pin mux value, both of them is 0x50004, log as following:

    [HOST] [IPU2  ]     40.171109 s: (1)MCASP4_ACLKX:MuxAddr = 0x4a003734, MuxVal = 0x50004

    [HOST] [IPU2  ]     40.171231 s: (1)MCASP4_FSX:MuxAddr = 0x4a003738, MuxVal = 0x50004

    now i have no idea to check what?

    best regards!

  • Hi,

    I2C4_sda and I2C4_scl pins would be connected on multiple pads of the soc with different mux modes.
    Make sure that in other pads, the mix mode is not selected for the I2C4 functionality.

    Can you probe the i2c pins when you are sending the commands to the slave (may be through a I2C signal analyzer).
    If the I2C signals are going properly then there could be an issue with the device powered up.

    Check if the voltage and timing requirements for powering on device are taken care of.

    Regards,
    Prasad

  • hi Prasad,
    Thanks for your reply,
    now i do an experiment, i try to detect adv7182 i2c device on A15 side by "i2cdetect" tools. after i do "insmod adv7180.ko"
    i can detect 0x20 device on I2C3 bus by the command: i2cdetect -y -r 3

    jacinto6evm:/ # i2cdetect -y -r 3
    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: -- -- -- -- -- -- -- -- -- UU -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: UU -- -- -- UU -- -- -- -- -- -- -- 2c -- -- --
    30: -- -- UU -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --

    so i check the adv7180 driver, i think the power up sequence is same to my power sequence on M4 side.

    i also do another experiment, i power up adv7182 chip by file system commands as following:
    // first pull down gpio2_0 and gpio1_30
    echo 32 > /sys/class/gpio/export
    echo out > /sys/class/gpio/gpio32/direction
    echo 0 > /sys/class/gpio/gpio32/value

    echo 30 > /sys/class/gpio/export
    echo out > /sys/class/gpio/gpio30/direction
    echo 0 > /sys/class/gpio/gpio30/value

    // then pull up gpio2_0 and gpio1_30
    echo 32 > /sys/class/gpio/export
    echo out > /sys/class/gpio/gpio32/direction
    echo 1 > /sys/class/gpio/gpio32/value

    usleep 5000

    echo 30 > /sys/class/gpio/export
    echo out > /sys/class/gpio/gpio30/direction
    echo 1 > /sys/class/gpio/gpio30/value

    this power up sequence is the same to the dataship.

    then i detect i2c bus agagin by command : i2cdetect -y -r 3
    but adv7182 (0x20) is not detected:
    jacinto6evm:/ # i2cdetect -y -r 3
    0 1 2 3 4 5 6 7 8 9 a b c d e f
    00: -- -- -- -- -- -- -- -- -- UU -- -- --
    10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    20: -- -- -- -- UU -- -- -- -- -- -- -- 2c -- -- --
    30: -- -- UU -- -- -- -- -- -- -- -- -- -- -- -- --
    40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
    70: -- -- -- -- -- -- -- --

    maybe i miss someting compare with the driver of adv7180.ko.

    best regards!

  • hi Prasad,

    i have found the problem, it is because the following code is not called  as the macro define BSP_DISABLE_I2C3:

    #ifndef BSP_DISABLE_I2C3
                            Vps_printf("BSP_DISABLE_I2C3 is not defined\n");
                            #ifdef USE_LINUX_INTC_NUMBERS
                            Vps_printf("USE_LINUX_INTC_NUMBERS is defined\n");
                            /* XBAR I2C4_IRQ to IPU1_44 */
                            BspOsal_irqXbarConnect(CSL_XBAR_INST_IPU1_IRQ_44, CSL_XBAR_I2C4_IRQ);
                            #else
                            Vps_printf("USE_LINUX_INTC_NUMBERS is not defined\n");
                            /* XBAR I2C4_IRQ to IPU1_48 */
                            BspOsal_irqXbarConnect(CSL_XBAR_INST_IPU1_IRQ_48, CSL_XBAR_I2C4_IRQ);
                            #endif  /* USE_LINUX_INTC_NUMBERS */
                        #endif  /* !BSP_DISABLE_I2C3 */
    best regards!