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.

PSP I2C driver does not always write to bus

Other Parts Discussed in Thread: TLV320AIC3106

devkit: LCDK6748

PSP version: 03 00 01 00

For some reason if I am trying to write to I2C address 0x10 (actual 7 bit address) I do not see any activity on the bus and GIO_submit returns with -1.

However if I tried with addresses 0x11, 0x12, etc I saw activity and ofcourse there was NAK , because actually those devices were not on bus. I also attached a picture about this trace. PS GIO_submit also returned -1, but there was also activity.

I attached my code as github gist (do not know how to do code formatting in E2E).

https://gist.github.com/4707015

Could you tell me if there is particular reason why 0x10 would fail?

Actually there is camera on this address, but strange thing is that nothing is written to bus, so I2C driver or camera could not possibly distract each other.

I think it is coincidence that it fails on device address.

Andres

  • I did more testing.

    Connected SDA and SCL lines to the Raspberry Pi and did a I2C bus scan from there. It returned following devices 0x10, 0x18, 0x5D.

    Then I did a simple python script to R/W to device 0x10, which is camera:

    import smbus

    i2c = smbus.SMBus(0)

    #read from address 0x3006
    i2c.write_byte_data(0x10, 0x30, 0x06)
    h = i2c.read_byte(0x10)
    l = i2c.read_byte(0x10)

    print 'returned: %04X' % (h<<8 | l)

    Indeed it worked and returned correct data.

    So, after that I tried again with C6748. Firstly I wrote to device 0x18 just to be sure. It worked - logic analyzer showed correct data.

    Then I tried same thing with device 0x10 and nothing happened, logic analyzer did not spot any traffic on I2C bus and GIO_submit returned with -1.

    It is so strange, other addresses except 0x10 seem to work (actually I have just tried some random address near this). By seem to work I mean, I see some traffic on I2C bus.

    How to debug it further, this -1 clearly indicates that something went completely wrong.

    Andres

  • I was able to change TLV320AIC3106 address to 0x1A on my LCDK and after that I also changed camera address from 0x10 to 0x18 using jumper cable.

    I changed TLV320AIC3106 address because it is by default also 0x18.

    After these changes I am able to communicate with the camera on address 0x18.

    There must be issue on I2C PSP drivers, because it does not make sense why it is not generating anything to I2C if address 0x10 is used.