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/DS90UB954-Q1EVM: MIPI I2C Write read reg configuration

Part Number: DS90UB954-Q1EVM
Other Parts Discussed in Thread: DS90UB953-Q1EVM, , ALP

Tool/software: Linux

Hi,

I have a setup that looks like this:

cmos sensor --> DS90UB953-Q1EVM --> DS90UB954-Q1EVM --> usb cable with TI ALP / I2C bus controlled with nvidia 

I managed to write from the usb to the three components (cmos+SerDes) but can't read 

Also, I can read and write to SerDes on I2C bus

The problem is that I have only succeeded to read by I2C bus from CMOS but I can't write through I2C

I don't understand how it is possible that I can read but not write..

Is it the EVM Bug or I just need to change something in the way I sens the command?

Dorin 

  • Hello Dorin,

    It sounds like some sort of I2C driver issue. Does your driver support I2C clock stretching? What Nvidia hardware are you using? TX2?

    Best Regards,

    Casey 

  • Hello Dorin,

    Our third party partners like Leopard Imaging or D3 may be able to assist with Linux drivers for Tegra. They have worked with us in the past on several platforms for TX2 already which should be very similar. Please verify that your driver supports I2C clock stretching. 

    Best Regards,
    Casey 

  • Hi,

    the Xavier and DeSerialize EVM are connected to the same I2C bus but the serializer EVM + cmos sensor are connected to a different, (fakra cable is connecting the EVM's)

    so i don't understand how could it be a problem with the Xavier, in addition i manage to read and write from the serializer by I2C so could it be something that i need to change in the serializer?

    it seems to me a problem with read and write addresses (I2C protocol read 'address', write 'address+1') I have only succeeded to read from the cmos so maybe the serializer doesn't pass the command with the correct write address ?

    Dorin

      

  • Hello Dorin,

    Do you have both ALP and the Nvidia board connected at the same time? Maybe there is some conflict between the masters? Can you please try doing register writes using just ALP by itself with your same configuration? 

    Best Regards,

    Casey

  • there is no conflict between the masters because we did this separately,

    one option is to use I2C through MIPI connector on Desirializer with no usb cable connected to the ALP (we succeeded only write command from CMOS)

    the second option is to use usb cable connected to the ALP (we succeeded only read command from CMOS)

    is there any option to read and write from the cmos while the SerDes connected to Xavier ?

    I add the opening of the script I use:
    # Set up IDs
    UB954 = 0x60 #0x7A
    UB953ID = 0x30
    UB953 = 0x30 #0x18
    sensorID = 0xC0
    sensorAlias = 0xC0

    # Set up Port0
    board.WriteI2C(UB954, 0x4C, 0x01)

    # Set up Back Channel Config (0x58)
    board.WriteI2C(UB954,0x58,0x5E)

    # Set up SER ID
    board.WriteI2C(UB954,0x5B,UB953ID)
    # Set up SER Alias ID
    board.WriteI2C(UB954,0x5C,UB953)
    # Set up Slave/Camera ID
    board.WriteI2C(UB954,0x5D,sensorID)
    # Set up Slave/Camera Alias ID
    board.WriteI2C(UB954,0x65,sensorAlias)

    # Set General config - 2-lane configuration
    board.WriteI2C(UB953,0x02,0x13)
    # Set GPIO2 and GPIO3 to outputs, where GPIO2 = RESET and GPIO3 = PWDN
    board.WriteI2C(UB953,0x0E,0xC0)
    # Set GPIO2 and GPIO3 to High - bring sensor out of power down mode
    board.WriteI2C(UB953,0x0D,0x0C)
    #time.sleep(0.1)
    time.sleep(5)
    # Bring GPIO3 low to place sensor in reset
    board.WriteI2C(UB953,0x0D,0x08)
    time.sleep(1)
    # Bring GPIO3 high again to prepare sensor for initialization
    board.WriteI2C(UB953,0x0D,0x0C)
    print "Sensor Reset"

    board.WriteI2C(sensorAlias,0x01, [0x03,0x01])

    board.Read2C(sensorAlias,0x01, 0x03)

    those are the read/write command I use on the cmos and only the write works from the ALP

    Dorin

  • Hello Dorin,

    Does your sensor use 16 bit I2C addresses? It looks like your write command is using a 16 bit address with an 8 bit register contents:

    board.WriteI2C(sensorAlias,0x01, [0x03,0x01])


    Should be writing 0x01 to register 0x0103, while 

    board.Read2C(sensorAlias,0x01, 0x03)


    Is reading 3 bytes from register 0x01. I think you actually want to read an 8 bit value from a 16 bit register right? So if you want to read back what you just wrote to register 0x0103 you would use:

    board.Read2C(sensorAlias,0x01, [0x03, 0x01])

    Best Regards,

    Casey 

  • Hey Dorin,

    Any feedback? Is this issue resolved with the above?

    Thanks,

    Casey 

  • Hi,

    this didn't work, the ALP wrote an error when I used this command

    board.Read2C(sensorAlias,0x01, [0x03, 0x01])

  • Hello Dorin,

    Sorry there is a small typo - the "I" in "I2C" is missing. Please try the following:

    board.ReadI2C(sensorAlias,0x01, [0x03, 0x01])