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.

DS90UB960-Q1: interfacing with UB953 based camera

Part Number: DS90UB960-Q1


Hello. I am having communication problems on I2C bus while serializer configuration and camera ISP configuration. My setup is:

  • vision sdk 3.0.7
  • late attach mode
  • pipeline on M4 core
  • custom TDA2PX based board
  • UB960 connected to TDA2PX via CSI2
  • 4 cameras connected to UB960 via FPD-Link III (camera itself is UB953 + ISP + Sensor)

When I am trying to detect UB953 by reading it's ID over i2c -- I get errors like this:

 [HOST] [IPU2  ]      2.491307 s: src/bsp_deviceI2c.c @ Line 346:
 [HOST] [IPU2  ]      2.491398 s:  I2C4: DEV 0x41: RD 0x50 ... ERROR !!!
 [HOST] [IPU2  ]      2.491490 s: src/bsp_deviceI2c.c @ Line 412:
 [HOST] [IPU2  ]      2.491581 s:  I2C4: Error timeout 0 ms!!!
 [HOST] [IPU2  ]      2.491642 s: i2c_read Failed

I hook up logic analyzer between TDA2PX and UB960 and I see NACK from UB953. Next, after 2-3 attempts UB953 starts to respond on I2C requests.

Same thing when I am trying to configure ISP: sometimes I have error like above and observe NACK from ISP.

This errors is not stable - on next power cycle there may be no errors at all, or may be such errors again.

UB960 config:

    device->write(device, 0x01, 0x02);
    Task_sleep(100);

    device->write(device, 0x1f, 0x00);     /*1.6gbps, 200mhz, external clock*/

    device->write(device, 0xB0, 0x1E);    /*select csi-2 reserved registers, auto increment on */
    device->write(device, 0xB1, 0x16);
    device->write(device, 0xB2, 0x00);    /* write 0x0 at 0x16 */
    device->write(device, 0xB2, 0x00);    /* write 0x0 at 0x17 */
    device->write(device, 0xB2, 0x00);    /* write 0x0 at 0x18 */
    device->write(device, 0xB2, 0x00);    /* write 0x0 at 0x19 */

    device->write(device, 0xB0, 0x1C);    /*select csi-2 reserved registers, auto increment off */
    device->write(device, 0xB1, 0x15);
    device->write(device, 0xB2, 0x0A);   /* this transactions has no effect */
    Task_sleep(10);
    device->write(device, 0xB2, 0x00);
    Task_sleep(10);

    device->write(device, 0x0D, 0xB9); /* force I/O to 3V3 (0x90 in softeq, but why?) */

    device->write(device, 0x32, 0x01); /* Enable TX port 0*/
    device->write(device, 0x20, 0x00); /* Forwarding and using CSIport 0 */
    device->write(device, 0x21, 0x03); /* Turn on round robin for both ports*/

    device->write(device, 0x19, 0x01); /* frame sync high time 1 */
    device->write(device, 0x1A, 0x15); /* frame sync high time 0*/
    device->write(device, 0x1B, 0x09); /* frame sync low time 1*/
    device->write(device, 0x1C, 0xC3); /* frame sync low time 0 */
    device->write(device, 0x18, 0x01); /* Start FSIN. Delay to allow it to stabilize */
    device->write(device, 0x33, 0x02);
    device->write(device, 0x10, 0x81); /* BC_GPIO0 RX0 */
    device->write(device, 0x11, 0x85); /* BC_GPIO1 RX1 */
    device->write(device, 0x12, 0x89); /* BC_GPIO0 RX2 */
    device->write(device, 0x13, 0x8D); /* BC_GPIO1 RX3 */
    device->write(device, 0x14, 0x0B); /* SYNC_CAMERA0 */
    device->write(device, 0x15, 0x00); /* BC_GPIO5 */
    device->write(device, 0x16, 0x00); /* BC_GPIO6 */
    device->write(device, 0x17, 0x00); /* BC_GPIO7 */

channel setup:

    Int32 status = BSP_SOK;
    UInt8 chan_sel4C;
    UInt8 chan_selB0;
    UInt8 reg_val = 0x0;

    chan_sel4C = ((1 * chan->channel_idx) << 4 | 1 << chan->channel_idx) & 0xFF;
    chan_selB0 = (4 * ( chan->channel_idx + 1)) & 0xFF;

    Vps_printf("%s: [%d:%d] chan_sel4C 0x%X, chan_selB0 0x%X...\n",
                __func__, des->csi_port_idx, chan->channel_idx, chan_sel4C, chan_selB0);

    status |= des->write(des, 0x4C, chan_sel4C);
    if (UB913 == chan->cam.serializer.id)
        status |= des->write(des, 0x58, 0x58); /*Enable Back channel, set to : 2.5 Mbps*/
    else {
        status |= des->write(des, 0x58, 0x5E); /*Enable Back channel, set to 50Mbs*/
    }

    /* select channel to configure */
    status |= des->write(des, 0x4C, chan_sel4C);
    status |= des->write(des, 0xB0, chan_selB0);
        /* set I2C alias */
    status |= des->write(des, 0x5C, (chan->cam.serializer.alias << 1));   /* serializer alias */
    Task_sleep(10);

    /* Replica R Settings */
    status |= des->write(des, 0xB1, 0x03);
    status |= des->write(des, 0xB2, 0x25);
    status |= des->write(des, 0xB1, 0x13);
    status |= des->write(des, 0xB2, 0x25);

    /* TRF control settings */
    status |= des->write(des, 0xB1, 0x04);
    status |= des->write(des, 0xB2, 0x30);
    status |= des->write(des, 0xB1, 0x14);
    status |= des->write(des, 0xB2, 0x30);

    /* VCO Initial Voltage Settings & RS */
    status |= des->write(des, 0xB1, 0x06);
    status |= des->write(des, 0xB2, 0x40);

    /* AEQ Settings */
    status |= des->write(des, 0x42, 0x71); /*Unknown*/
    status |= des->write(des, 0x41, 0xF0); /*Unknown*/
    status |= des->write(des, 0xD5, 0xF3);
    Task_sleep(10);

    if (UB953 == chan->cam.serializer.id) {
        status |= des->write(des, 0x6D, 0x7C); /*CSI Mode*/

        status |= des->write(des, 0x72, (0x55*(UInt8)(chan->channel_idx))); /*VC Map - All to RX0->VC=0 RX1->VC=1 ...*/
        status |= des->write(des, 0x7C, 0x24); /*Line Valid active high, Frame Valid active high*/
        Task_sleep(10);
    } else if (UB913 == chan->cam.serializer.id){
        if (SYSTEM_CSI2_RAW8 == chan->csiFormat
            || SYSTEM_CSI2_YUV420_8B == chan->csiFormat
            || SYSTEM_CSI2_YUV420_8B_CHROMA_SHIFT == chan->csiFormat
            || SYSTEM_CSI2_YUV422_8B == chan->csiFormat) {
            status |= des->write(des, 0x7C, 0x81); /* 8-bit processing using upper 10 bits, FrameValid is low */
            status |= des->write(des, 0x6D, 0x7F); /* RAW10 mode */
        } else if (SYSTEM_CSI2_RAW10 == chan->csiFormat
                  || SYSTEM_CSI2_YUV420_10B == chan->csiFormat
                  || SYSTEM_CSI2_YUV420_10B_CHROMA_SHIFT == chan->csiFormat
                  || SYSTEM_CSI2_YUV422_10B == chan->csiFormat) {
            status |= des->write(des, 0x7C, 0x01); /* 8-bit processing using upper 8 bits, FrameValid is low */
            status |= des->write(des, 0x6D, 0x7F); /* RAW10 mode */
        }else { //RAW12
            status |= des->write(des, 0x7C, 0x01); /* 8-bit processing using upper 8 bits, FrameValid is low */
            status |= des->write(des, 0x6D, 0x7E); /* RAW12 High Frequency mode */
        }
        status |= des->write(des, 0x70, (UInt8)(chan->channel_idx << 6) | (UInt8)chan->csiFormat); /* RAW10 setting*/
        status |= des->write(des, 0x71, (UInt8)(chan->channel_idx << 6) | (UInt8)chan->csiFormat); /* RAW12 setting*/
    } else {
        Vps_printf("%s Unknown Serializer ID=0x%02X\n",__func__,chan->cam.serializer.id);
        UTILS_assert(FALSE); /* Unknown Serializer ID */
    }
    UInt32 counter = 1000;
    while (counter) {
        status |= des->write(des, 0x4C, chan->channel_idx << 4);
        status |= des->read(des, 0x5B, &reg_val);
        if (reg_val)
            break;

        Task_sleep(10);
        counter -= 10;
    }

    if (!reg_val) {
        Vps_printf("%s: [%d:%d] autoload of serializer i2c addres failed\n", __func__, chan->csi_port_idx, chan->channel_idx);
        return BSP_EFAIL;
    }

    Vps_printf("%s: [%d:%d] end (%02X, cntr: %d, status: %d)\n", __func__, chan->csi_port_idx, chan->channel_idx, reg_val, counter, status);

  • Hello,

    Just to clarify, there are intermittent i2c error seen by the SoC when trying to read from the remote serializer correct?  Have you tried probing the remote i2c bus with the logic analyzer to see if the i2c communication is making through the link?

    Also are you able to provide RX_PORT_STS register values (0x4D and 0x4E) of the 954? 

    Have you tried setting I2C_PASS_THROUGH_ALL 0x58[7] and if so are you able to receive anything from the remote device?

    Regards,

    Nick

  • Nicholas Darash said:

    Hello,

    Just to clarify, there are intermittent i2c error seen by the SoC when trying to read from the remote serializer correct?  Have you tried probing the remote i2c bus with the logic analyzer to see if the i2c communication is making through the link?

    Also are you able to provide RX_PORT_STS register values (0x4D and 0x4E) of the 954? 

    Have you tried setting I2C_PASS_THROUGH_ALL 0x58[7] and if so are you able to receive anything from the remote device?

    Regards,

    Nick

    Yes, you are correct - error occurs when SoC tries to read from remote serializer or isp.

    Unfortunatelly I can't disassembly camera to connect my logic analyzer between UB953 and ISP, so I use development board with UB953 with at24 eeprom connected to UB953 for debug i2c bus after serializer.

    When such errors occurs while SoC read/write eeprom - on logic analyzer it looks like NACK on I2C bus between SoC and UB960 and at this moment there is no transactions on I2C bus after UB953.

    I will provide RX_PORT_STS values for each port during the day.

  •  [HOST] [IPU2  ]     64.123955 s: UB960_chan_stats: [0:0] RX_PORT_STS1 = 0x03 end                                                                                                                                          
     [HOST] [IPU2  ]     64.125968 s: UB960_chan_stats: [0:1] RX_PORT_STS1 = 0x4B end                                                              
     [HOST] [IPU2  ]     64.127950 s: UB960_chan_stats: [0:2] RX_PORT_STS1 = 0x83 end                                                              
     [HOST] [IPU2  ]     64.129964 s: UB960_chan_stats: [0:3] RX_PORT_STS1 = 0xC3 end

    I have all 4 port connected with UB953 serializers. But on this boot only 0 port was successfully configured, the rest of ports has errors on I2C bus:

    Port 1:
    
    
     [HOST] [IPU2  ]      2.733300 s: UB953_detect: [0:1] detected alias=0x41 (orig=0x18) dev_id=0x20                                              
     [HOST] [IPU2  ]      2.733422 s: RDACM51_serializer_init: reset successfull                                                                   
     [HOST] [IPU2  ]      2.736045 s: src/bsp_deviceI2c.c @ Line 580:                                                                              
     [HOST] [IPU2  ]      2.736167 s:  I2C4: DEV 0x41: WR 0xb0 = 0x04 ... ERROR !!!                                                                
     [HOST] [IPU2  ]      2.736259 s: src/bsp_deviceI2c.c @ Line 602:                                                                              
     [HOST] [IPU2  ]      2.736350 s:  I2C4: Error timeout 1 ms!!!                                                                                 
     [HOST] [IPU2  ]      2.736411 s: i2c_write Failed                                                                                             
     [HOST] [IPU2  ]      2.737570 s: src/bsp_deviceI2c.c @ Line 580:                                                                              
     [HOST] [IPU2  ]      2.737662 s:  I2C4: DEV 0x41: WR 0xb1 = 0x08 ... ERROR !!!                                                                
     [HOST] [IPU2  ]      2.737753 s: src/bsp_deviceI2c.c @ Line 602:                                                                              
     [HOST] [IPU2  ]      2.737845 s:  I2C4: Error timeout 0 ms!!!                                                                                 
     [HOST] [IPU2  ]      2.737906 s: i2c_write Failed                                                                                             
     [HOST] [IPU2  ]      2.738577 s: src/bsp_deviceI2c.c @ Line 580:                                                                              
     [HOST] [IPU2  ]      2.738668 s:  I2C4: DEV 0x41: WR 0xb2 = 0x07 ... ERROR !!!                                                                
     [HOST] [IPU2  ]      2.738790 s: src/bsp_deviceI2c.c @ Line 602:                                                                              
     [HOST] [IPU2  ]      2.738851 s:  I2C4: Error timeout 0 ms!!!                                                                                 
     [HOST] [IPU2  ]      2.738912 s: i2c_write Failed                                                                                             
     [HOST] [IPU2  ]      2.759592 s: src/bsp_deviceI2c.c @ Line 580:                                                                              
     [HOST] [IPU2  ]      2.759684 s:  I2C4: DEV 0x41: WR 0x0e = 0x3c ... ERROR !!!                                                                
     [HOST] [IPU2  ]      2.759775 s: src/bsp_deviceI2c.c @ Line 602:                                                                              
     [HOST] [IPU2  ]      2.759867 s:  I2C4: Error timeout 0 ms!!!                                                                                 
     [HOST] [IPU2  ]      2.759928 s: i2c_write Failed                                                                                             
     [HOST] [IPU2  ]      2.760599 s: src/bsp_deviceI2c.c @ Line 580:                                                                              
     [HOST] [IPU2  ]      2.760690 s:  I2C4: DEV 0x41: WR 0x0d = 0x00 ... ERROR !!!                                                                
     [HOST] [IPU2  ]      2.760782 s: src/bsp_deviceI2c.c @ Line 602:                                                                              
     [HOST] [IPU2  ]      2.760873 s:  I2C4: Error timeout 0 ms!!!                                                                                 
     [HOST] [IPU2  ]      2.760934 s: i2c_write Failed                                                                                             
     [HOST] [IPU2  ]      2.845299 s: RDACM51_serializer_init: [0:1] end                                                                           
     [HOST] [IPU2  ]      2.845391 s: RDACM51_init: [0:1] failed to init serializer

    Port 3:

     [HOST] [IPU2  ]      3.209449 s: RDACM51_init: [0:3] start                                                                                    
     [HOST] [IPU2  ]      3.209510 s: RDACM51_init: [0:3] trying to detect serializer                                                              
     [HOST] [IPU2  ]      3.209601 s: UB953_detect: [0:3] start                                                                                    
     [HOST] [IPU2  ]      3.210303 s: UB953_detect: [0:3] detected alias=0x43 (orig=0x18) dev_id=0x20                                              
     [HOST] [IPU2  ]      3.210425 s: RDACM51_serializer_init: [0:3] start                                                                         
     [HOST] [IPU2  ]      3.211309 s: UB953_detect: [0:3] start                                                                                    
     [HOST] [IPU2  ]      3.211675 s: src/bsp_deviceI2c.c @ Line 346:                                                                              
     [HOST] [IPU2  ]      3.211767 s:  I2C4: DEV 0x43: RD 0x50 ... ERROR !!!                                                                       
     [HOST] [IPU2  ]      3.211858 s: src/bsp_deviceI2c.c @ Line 412:                                                                              
     [HOST] [IPU2  ]      3.211919 s:  I2C4: Error timeout 0 ms!!!                                                                                 
     [HOST] [IPU2  ]      3.211980 s: i2c_read Failed                                                                                              
     [HOST] [IPU2  ]      3.222595 s: src/bsp_deviceI2c.c @ Line 346:                                                                              
     [HOST] [IPU2  ]      3.222686 s:  I2C4: DEV 0x43: RD 0x50 ... ERROR !!!                                                                       
     [HOST] [IPU2  ]      3.222778 s: src/bsp_deviceI2c.c @ Line 412:                                                                              
     [HOST] [IPU2  ]      3.222839 s:  I2C4: Error timeout 0 ms!!!                                                                                 
     [HOST] [IPU2  ]      3.222900 s: i2c_read Failed                                                                                              
     [HOST] [IPU2  ]      3.234307 s: UB953_detect: [0:3] detected alias=0x43 (orig=0x18) dev_id=0x20                                              
     [HOST] [IPU2  ]      3.234459 s: RDACM51_serializer_init: reset successfull                                                                   
     [HOST] [IPU2  ]      3.259592 s: src/bsp_deviceI2c.c @ Line 580:                                                                              
     [HOST] [IPU2  ]      3.259714 s:  I2C4: DEV 0x43: WR 0x0e = 0x3c ... ERROR !!!                                                                
     [HOST] [IPU2  ]      3.259806 s: src/bsp_deviceI2c.c @ Line 602:                                                                              
     [HOST] [IPU2  ]      3.259867 s:  I2C4: Error timeout 0 ms!!!                                                                                 
     [HOST] [IPU2  ]      3.259928 s: i2c_write Failed                                                                                             
     [HOST] [IPU2  ]      3.260599 s: src/bsp_deviceI2c.c @ Line 580:                                                                              
     [HOST] [IPU2  ]      3.260690 s:  I2C4: DEV 0x43: WR 0x0d = 0x00 ... ERROR !!!                                                                
     [HOST] [IPU2  ]      3.260812 s: src/bsp_deviceI2c.c @ Line 602:                                                                              
     [HOST] [IPU2  ]      3.260873 s:  I2C4: Error timeout 0 ms!!!                                                                                 
     [HOST] [IPU2  ]      3.260934 s: i2c_write Failed                                                                                             
     [HOST] [IPU2  ]      3.345299 s: RDACM51_serializer_init: [0:3] end                                                                           
     [HOST] [IPU2  ]      3.345391 s: RDACM51_init: [0:3] failed to init serializer                                                                

  • Hello again,

    There is quite a bit of information attached here.  I want to make sure I understand the issue at a high level, so there are intermittent i2c comms issues but it appears that lock and pass is valid?  Have you ensured that board design and layout meets guidelines set in the datasheet?  Also it is important that the SoC is capable of supporting clock stretching.  If there is quite a bit of delay from the i2c being replicated across the link the deserializer may stretch the clock in response to that.  It is also important to make sure proper external pull-up resistors have been used for communication to work.

    Unfortunately there isn't much to do with the deserializer to diagnose i2c issues.  The fact that it is intermittent leads me to believe that it is an issue with the i2c bus itself.  And the fact that pass and lock are showing valid makes me believe that the link is fine.

    Regards,

    Nick

  • Nicholas Darash said:

    Hello again,

    There is quite a bit of information attached here.  I want to make sure I understand the issue at a high level, so there are intermittent i2c comms issues but it appears that lock and pass is valid?  Have you ensured that board design and layout meets guidelines set in the datasheet? 

    Also it is important that the SoC is capable of supporting clock stretching.  If there is quite a bit of delay from the i2c being replicated across the link the deserializer may stretch the clock in response to that.  It is also important to make sure proper external pull-up resistors have been used for communication to work.

    Unfortunately there isn't much to do with the deserializer to diagnose i2c issues.  The fact that it is intermittent leads me to believe that it is an issue with the i2c bus itself.  And the fact that pass and lock are showing valid makes me believe that the link is fine.

    Regards,

    Nick

    Hello Nick, thank you for your reply.

    Some additional information: yesterday I turn on CR for BC and AEQ Error Control in ub960. After that behavior has changed: all detection and configuration of remote serializers and isp pass without an error, but when cameras started to stream video - I got corrupted frames, lots of it. For channels 1 and 3 FPS drop to 8-10.

    Does it mean that there is hardware issue with FPD-Link?

  • Hello again,

    It does sound like a hardware issue, you can test using the pattern generator in the serializer to verify if the issue is between the SERDES pair or between the serializer and sensor.  If the issue is in the FPD-Link, TI has a margin analysis tool built in to Analog LaunchPAD that can be used to find ideal AEQ settings.  The MAP tool will help dial in the AEQ and create a more stable link.  Information on how to use the tool can be found here http://www.ti.com/lit/an/snla301/snla301.pdf.

    Regards,

    Nick