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: UB960 CSI-2 PORT Frame Counter with Errors

Part Number: DS90UB960-Q1

Hi Ti :

We use the following scheme : sensor->ub935->ub960 

Now I have a problem in the debugging process, I use one camera ,so one ub935 connect to ub960 rx-port0,  and select CSI-2 TX Port 1,but I can't get the video from my soc.then I read 0x93-0x94(Frame Counter with Errors) and 0x96-0x97( Line Counter with Errors ), omg, All video frames are wrong    !

 I dump the i2c reg from ub935 and ub960,  I hope I can get help.

~ # i2cdump -f -y 1 0x30
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 60 00 1e 40 d0 01 00 fe 1c 10 7a 7a 11 09 40 fb    `.?@??.???zz??@?
10: 00 00 13 00 00 00 00 00 00 00 00 00 00 00 04 07    ..?...........??
20: e1 08 00 91 00 00 00 00 00 00 00 00 00 00 00 00    ??.?............
30: 00 00 12 03 00 10 00 00 00 00 00 00 00 00 00 00    ..??.?..........
40: 00 a9 71 01 00 00 20 00 00 00 00 12 01 03 14 64    .?q?.. ....????d
50: 00 00 00 03 02 00 00 00 5e 00 00 30 80 20 00 00    ...??...^..0? ..
60: 00 00 00 00 00 90 00 00 00 00 00 00 00 7c 88 88    .....?.......|??
70: 2b 2c e4 00 16 07 80 c5 00 01 00 00 20 00 00 00    +,?.????.?.. ...
80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
90: 00 00 00 00 00 00 00 00 00 1e 00 1e 5c 7b 5c 1e    .........?.?\{\?
a0: 00 00 00 00 00 1c 00 00 00 00 00 00 00 00 00 00    .....?..........
b0: 02 49 00 08 25 00 18 00 88 33 83 74 80 00 00 00    ?I.?%.?.?3?t?...
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
d0: 00 43 94 0f 60 f0 00 02 00 69 00 10 00 00 00 00    .C??`?.?.i.?....
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
f0: 5f 55 42 39 36 30 00 00 00 00 00 00 00 00 00 00    _UB960..........
~ # i2cdump -f -y 1 0x40
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 30 00 53 48 00 03 9b fa fe 1e 10 7f 7f e1 1e 00    0.SH.??????????.
10: 00 00 00 00 00 20 18 3c 80 62 62 62 00 00 00 00    ..... ?<?bbb....
20: 00 00 00 00 00 02 00 00 67 33 01 00 00 00 00 00    .....?..g3?.....
30: 00 20 09 04 00 10 00 60 00 00 00 00 00 00 00 00    . ??.?.`........
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
50: 20 c0 47 02 00 06 00 00 07 07 07 00 01 00 44 00     ?G?.?..???.?.D.
60: 00 2c 80 07 0d 88 00 00 00 00 00 00 00 00 00 00    .,????..........
70: 00 00 25 00 00 00 00 00 00 00 e4 00 00 00 00 00    ..%.......?.....
80: 00 00 00 00 00 00 90 00 00 00 00 00 07 00 00 00    ......?.....?...
90: 32 e3 64 01 00 00 00 00 00 00 03 05 00 00 20 0f    2?d?......??.. ?
a0: 00 0e 0e 0d 0d 10 42 10 10 10 03 01 00 00 00 00    .?????B?????....
b0: 04 4a 3f 00 00 00 00 00 00 00 00 00 00 00 00 00    ?J?.............
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
f0: 5f 55 42 39 35 33 00 00 00 00 00 00 00 00 00 00    _UB953..........

  • Hello,

    The vertical resolution (line count) can be read in 960 registers 0x73 and 0x74. The value read in registers 0x73 and 0x74 are in pixels.


    The horizontal resolution (line length) can be read in 960 registers 0x75 and 0x76. The value read in registers 0x75 and 0x76 are in byte. It can be converted to pixels using the following equation:
    Horizontal Resolution (pixels) = Horizontal resolution (in byte) * 8 (bits/byte) / # bpp​

    From the register dump you provided, it seems like the 935 is detecting CSI errors on its receiver. This means that the camera isn't initialized properly. 

    Best,

    Jiashow

  • Dear Jiashow:

    Thank you for answering my question

    My camera is configured to work normally on other UB954 and UB935.

    I read   0x73 and 0x74   get  vin:# Line Count : 720 

    I read   0x75 and 0x76   get  vin:# Line Length : 1920    1920 * 8 / 12 = 1280

    My camera resolution is 1280 x 720 ,That's right。Now I read  0x90 and 0x91 frame counter only 17 ,my camera is 30 fps, So that means loss frame.

    But read 0x92 and 0x93 no error.

    Above is my use of 400M (write 0x07 to 0x1f) configuration, I measured the UB935 CLK_OUT with an oscilloscope ,Only half the normal clock,Is that

    why the frame rate is wrong?

    When I use 400Mbps(write 0x03 to 0x1f), 800Mbps, 1.2Gbps, 1.6Gbps (0x1f),  I read the frame rate( 0x90 and 0x91 ) correctly, but it was all error ( 0x92 and 0x93 ), My soc support 2.5Gbps/Lane, So I'm wondering why is that. Could this be a hardware interference problem?

    This is my first time to use Ub960, so I don't know much about this configuration. Could you please provide me with a register configuration of Ub960 and UB935.

    Thank you very much at last

  • Let me just add:

    When I use 400Mbps(write 0x03 to 0x1f), 800Mbps, 1.2Gbps, 1.6Gbps (0x1f),  I read 0x73 and 0x74 , This value is going to fluctuate, not a fixed value.

  • I read registers 0xDB 

    vin:0xDB data :
    vin:# IS_LINE_LEN_CHG INTERRUPT DETECTED
    vin:# IS_LINE_CNT_CHG DETECTED
    vin:# IS_CSI_RX_ERR DETECTED
    vin:# IS_PORT_PASS DETECTED
    vin:# IS_LOCK_STS DETECTED
    vin:0xDA PORT_ISR_HI :
    vin:# IS_FPD3_ENC_ERR DETECTED
    vin:# IS_BCC_SEQ_ERR DETECTED
    vin:# IS_BCC_CRC_ERR DETECTED

    The LOCK and PASS state is changing all the time. Does that mean my hardware is having interference problems with high-speed transmission

  • Hello,

    Registers 0x90 and 0x91 just counts the number of frame_end signals (and gets reset after read). It does not indicate the frame rate.

    If you are configuring for 400Mbps CSI output, you need to configure additional registers. Refer to section 7.4.19 in the datasheet. The CSI rate is in Mbps, so if you convert it to MHz, you'll need to divide it by 2.

    Register 0x73 and 0x74 shouldn't fluctuate. If it does, it means the line count isn't stable and mostly likely caused by the camera not initialized properly. Based on your reported CSI errors, I would double check the camera initialization script.

    Here's an example init script for the 960:

    #reset
    board.WriteI2C(devAddr,0x01,0x01)

    #Selects Port
    board.WriteI2C(devAddr,0x4c,d_ch)
    time.sleep(0.1)

    # setup Ser ID and Alias
    board.WriteI2C(devAddr, 0x5B, serAddr)
    board.WriteI2C(devAddr, 0x5C, ser_alias)

    # setup Cam ID and Alias
    board.WriteI2C(devAddr,0x5D,camAddr)
    board.WriteI2C(devAddr,0x65,cam_alias)

    #Set BC rate
    board.WriteI2C(devAddr,0x58,0x5E)
    time.sleep(0.1)

    #Reset serializer
    board.WriteI2C(serAlias, 0x01, 0x01)

    ####insert camera initialization code here####

    #CSI output

    board.WriteI2C(devAddr, 0x32, 0x01) #Read CSI port 0,write CSI port 0
    board.WriteI2C(devAddr, 0x1F, 0x00) #Set timing register to 1600Mbps
    board.WriteI2C(devAddr, 0x20, 0xF0) #Disable RX Port Forwarding
    board.WriteI2C(devAddr, 0x33, 0x03) #enable CSI and continuous clock
    board.WriteI2C(devAddr, 0x20, 0x00) #Forward all RX Ports to CSI Ports 0

     Best,

    Jiashow

  • Hi Jiashow:

    I have configured all the places you mentioned, but they still cannot work properly.

    I measured the camera signal with an oscilloscope. The height and frame rate of the video were correct, but the signal was wrong after making it ub960

    I'll do some research on my own. Of course, if you have any other Suggestions, I hope you can help me.

    Thank you very much at last!

  • Hello,

    Is register 0x35[0] = b'0? If so, it means there's no valid CSI data coming out of the CSI port. I would recommend checking the camera initialization, since it seems like there's CSI errors detected.

    Best,

    Jiashow

  • Hi Jiashow:

    I used the UB935 test mode to verify this, excluding the camera first,

    Thanks!