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.

I Can not read and write register of devices under I2C

I probed all the devices under I2C4.

[14:51:09] [HOST] [IPU2 ] 20.480296 s: I2C4: Passed for address 0x30 !!!
[14:51:09] [HOST] [IPU2 ] 20.481638 s: I2C4: not Passed for address 0x31 !!!
[14:51:09] [HOST] [IPU2 ] 20.483011 s: I2C4: not Passed for address 0x32 !!!
[14:51:09] [HOST] [IPU2 ] 20.484353 s: I2C4: not Passed for address 0x33 !!!
[14:51:09] [HOST] [IPU2 ] 20.485695 s: I2C4: Passed for address 0x34 !!!
[14:51:09] [HOST] [IPU2 ] 20.487067 s: I2C4: not Passed for address 0x35 !!!
[14:51:09] [HOST] [IPU2 ] 20.488409 s: I2C4: not Passed for address 0x36 !!!
[14:51:09] [HOST] [IPU2 ] 20.489751 s: I2C4: not Passed for address 0x37 !!!
[14:51:09] [HOST] [IPU2 ] 20.491124 s: I2C4: Passed for address 0x38 !!!
[14:51:09] [HOST] [IPU2 ] 20.492466 s: I2C4: not Passed for address 0x39 !!!
[14:51:09] [HOST] [IPU2 ] 20.493808 s: I2C4: not Passed for address 0x3a !!!
[14:51:09] [HOST] [IPU2 ] 20.495150 s: I2C4: not Passed for address 0x3b !!!
[14:51:09] [HOST] [IPU2 ] 20.496492 s: I2C4: Passed for address 0x3c !!!
[14:51:09] [HOST] [IPU2 ] 20.497864 s: I2C4: Passed for address 0x3d !!!

0x30,0x34,0x38,0x3c,0x3d are the address of devices I am using.

But,when I use Bsp_deviceWrite8() or Bsp_deviceRead8() to write or read the registers of the devices .

[HOST] [IPU2 ] 330.741871 s: src/bsp_deviceI2c.c @ Line 377:
[HOST] [IPU2 ] 330.741932 s: read retVal-== IOM_ETIMEOUT !!!
[HOST] [IPU2 ] 330.743518 s: src/bsp_deviceI2c.c @ Line 394:
[HOST] [IPU2 ] 330.743610 s: I2C4: DEV 0x3d: RD 0x00 ... ERROR !!!
[HOST] [IPU2 ] 330.743701 s: src/bsp_deviceI2c.c @ Line 460:
[HOST] [IPU2 ] 330.743793 s: I2C4: Error timeout 5001 ms!!!

 Result shows timeout.

Thanks,

chengbo

  • Hi,

    Since the probe is working the I2C line configuration should be proper.

    Can you check the interrupt configuration and the Interrupt crossbar configuration?
    I think the I2C driver is configured in the interrupt mode and the read/write will timeout if the interrupts are not configured properly.

    Which version of sw are you using? and where are you adding the probe and read APIs?

    Regards,
    Prasad
  • I checked the interrupt settings.And I have set it up.
    The sdk I am using is PROCESSOR_SDK_VISION_03_06_00_00_setuplinux.
    I use GIO_control(gBspDevObj.i2cHndl[i2cInstId], IOCTL_I2C_PROBE,&slaveAddr) to probe and Bsp_deviceRead8() to read.
    I want to use I2C4 to control my devices.I have completed the configuration to probe , but I can not use Bsp_deviceRead8() and Bsp_deviceWrite8() .
  • Hi,

    Which instance of I2C are you using?

    Can you check the value of the I2C_IRQSTATUS register value after calling the read API?

    Regards,
    Prasad