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.

AM62A7-Q1: Adapting to a new camera, AM62A cannot recognize image data

Part Number: AM62A7-Q1
Other Parts Discussed in Thread: SK-AM62A-LP

Hi,

I tried to adapt a new camera. The data path is Sensor --> Max9295 --> Max96716. Max96716 outputs 16-bit YUV data. After loading the driver, AM62A cannot recognize the input data. Check the value of register 0x30101060 of AM62A. 0x10000000, the meaning of this value is WAIT_FOR_PACKET. Use an oscilloscope to check the lane signal. The signal is sent to AM62A normally. I now have the following problems:
1. What is the cause of WAIT_FOR_PACKET?
2. Is there a reference driver code for YUV output format in the PSDK provided by TI?
Note: The data line is 2 lane

Thanks,

yuwei.wu

  • Hello Yuwei,

    1. What is the cause of WAIT_FOR_PACKET?

    Most likely this was caused by mismatching format. The CSI2 Rx driver doesn't support 16-bit YUV data. Please refer to the source code of the driver:

    2. Is there a reference driver code for YUV output format in the PSDK provided by TI?

    Please check the above provided code for reference. In addition, please refer to OV5640 driver which has support for 8-bit YUV.

    Regards,

    Jianzhong

  • Hi Jianzhong:

    I reconfirmed my data format. The data format is UYVY422 8bit. I rewrote the driver with reference to OV2312 and mainly modified the format configuration.

    However, AM62A still cannot receive the MIPI signal, and the oscilloscope can measure the MIPI signal output.

    The camera can be lit normally on other devices. My questions are as follows:

    1.Does AM62A have a series of related debug registers that can be viewed?

    2. Has TI provided any troubleshooting guide for such problems?

    3. Do you have any suggestions to solve the problem?

    Regards,

    Yuwei

  • Hi Yuwei,

    The first step is to get the sensor probed. Did you get any video nodes created by the V4L2 framework? What does "v4l2-ctl --list-devices" show? How about "media-ctl -p"?

    Regards,

    Jianzhong

  • Hi Jianzhong,

    I confirmed that I configured the V4L2 framework correctly and loaded the driver correctly. The results I obtained using the command are as follows:

    “v4l2-ctl --list-devices”

    j721e-csi2rx (platform:30102000.ticsi2rx):
            /dev/video2
            /dev/video3
            /dev/video4
            /dev/video5
            /dev/video6
            /dev/video7
            /dev/media0
    
    wave5-dec (platform:wave5-dec):
            /dev/video0
    
    wave5-enc (platform:wave5-enc):
            /dev/video1

    "media-ctl -p"

    Media device information
    ------------------------
    driver      [  406.177657] INFO [ov2312_get_fmt]:function is running!
        j721e-csi2rx
    model           TI-CSI2RX
    serial
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  5.10.168
    
    Device topology
    - entity 1: 30102000.ticsi2rx (7 pads, 7 links, 1 route)
                type V4L2 subdev subtype Unknown flags 0
                device node name /dev/v4l-subdev0
            routes:
                    0/0 -> 1/0 [ACTIVE]
            pad0: Sink
                    [stream:0 fmt:YUYV8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:YUYV8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    -> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE]
            pad2: Source
                    -> "30102000.ticsi2rx context 1":0 [ENABLED,IMMUTABLE]
            pad3: Source
                    -> "30102000.ticsi2rx context 2":0 [ENABLED,IMMUTABLE]
            pad4: Source
                    -> "30102000.ticsi2rx context 3":0 [ENABLED,IMMUTABLE]
            pad5: Source
                    -> "30102000.ticsi2rx context 4":0 [ENABLED,IMMUTABLE]
            pad6: Source
                    -> "30102000.ticsi2rx context 5":0 [ENABLED,IMMUTABLE]
    
    - entity 9: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 0 route)
                type V4L2 subdev subtype Unknown flags 0
                device node name /dev/v4l-subdev1
            pad0: Sink
                    [stream:0 fmt:YUYV8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    <- "ovt,ox03c 2-0036":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:YUYV8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
            pad2: Source
                    [stream:0 fmt:YUYV8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            pad3: Source
                    [stream:0 fmt:YUYV8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            pad4: Source
                    [stream:0 fmt:YUYV8_1X16/640x480 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
    
    - entity 15: ovt,ox03c 2-0036 (1 pad, 1 link, 0 route)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev2
            pad0: Source
                    [stream:0 fmt:UYVY8_1X16/1600x1300 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
                    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    
    - entity 21: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video2
            pad0: Sink
                    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 27: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video3
            pad0: Sink
                    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 33: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video4
            pad0: Sink
                    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 39: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video5
            pad0: Sink
                    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    - entity 45: 30102000.ticsi2rx context 4 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video6
            pad0: Sink
                    <- "30102000.ticsi2rx":5 [ENABLED,IMMUTABLE]
    
    - entity 51: 30102000.ticsi2rx context 5 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video7
            pad0: Sink
                    <- "30102000.ticsi2rx":6 [ENABLED,IMMUTABLE]
    
    

    The core of the problem now is: Why is there a signal entering AM62A, but AM62A is displayed in the WAIT_FOR_PACKET state?

    Regards,

    Yuwei

  • Hello Yuwei,

    Your cdns_csi2rx.30101000.csi-bridge has different format than the sensor. That's most likely the reason why AM62A is in WAIT_FOR_PACKET.

    Please try to configure it to have the same format as the sensor, for example:

    media-ctl -V '"cdns_csi2rx.30101000.csi-bridge":0 [fmt:UYVY8_1X16/1600x1300 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]'

    Regards,

    Jianzhong

  • Hi Jianzhong,

    I configured V4L2_CID_PIXEL_RATE in the camera driver and am now able to receive data using 'v4l2-ctl -d /dev/video2 --set-fmt-video=width=1600,height=1300,pixelformat=UYVY --stream-mmap --stream-loop' tests the camera frame rate. Sometimes there is no frame rate output at all. The relevant log is as follows:

    root@am62axx-evm:~/ov2312_bring_up# [  350.237279] j721e-csi2rx 30102000.ticsi2rx: remote_pad->stream_count 1
    [  350.243926] j721e-csi2rx 30102000.ticsi2rx: routing->num_routes 1
    [  350.250127] j721e-csi2rx 30102000.ticsi2rx: r->source_pad 1 remote_pad->index 1
    [  350.257742] INFO [ov2312_get_fmt]:function is running!
    [  350.262955] cdns-csi2rx 30101000.csi-bridge: bpp 16 has_fd 0
    [  350.268731] cdns-csi2rx 30101000.csi-bridge:  Dump DPHY Configure link_freq 450000000
    [  350.268737] cdns-csi2rx 30101000.csi-bridge:  Dump DPHY Configure hs_clk_rate 450000000
    [  350.268741] cdns-csi2rx 30101000.csi-bridge:  Dump DPHY Configure lanes 4
    [  350.269115] cdns-csi2rx 30101000.csi-bridge:  csi2rx_configure_external_dphy ret 0
    [  350.299355] ovt,ox03c 2-0036: INFO:[ov2312_s_stream]:function running
    [  350.306188] j721e-csi2rx 30102000.ticsi2rx: Start DMA: 0 sizeimage 4160000
    
    root@am62axx-evm:~/ov2312_bring_up# devmem2 0x30101020
    /dev/mem opened.
    Memory mapped at address 0xffff9f4f5000.
    Read at address  0x30101020 (0xffff9f4f5020): 0x00000000
    root@am62axx-evm:~/ov2312_bring_up# devmem2 0x30102020
    /dev/mem opened.
    Memory mapped at address 0xffff98c65000.
    Read at address  0x30102020 (0xffff98c65020): 0x8C00001E
    

    Sometimes the frame rate can be detected, but the frame rate is obviously wrong (the camera output frame rate is 30). The relevant log is as follows:

    root@am62axx-evm:~/ov2312_bring_up# v4l2-ctl -d /dev/video2 --set-fmt-video=width=1600,height=1300,pixelformat=UYVY --stream-mmap --stream-loop
    [  370.633664] j721e-csi2rx 30102000.ticsi2rx: remote_pad->stream_count 1
    [  370.640331] j721e-csi2rx 30102000.ticsi2rx: routing->num_routes 1
    [  370.646532] j721e-csi2rx 30102000.ticsi2rx: r->source_pad 1 remote_pad->index 1
    [  370.654139] INFO [ov2312_get_fmt]:function is running!
    [  370.659358] cdns-csi2rx 30101000.csi-bridge: bpp 16 has_fd 0
    [  370.665138] cdns-csi2rx 30101000.csi-bridge:  Dump DPHY Configure link_freq 450000000
    [  370.665144] cdns-csi2rx 30101000.csi-bridge:  Dump DPHY Configure hs_clk_rate 450000000
    [  370.665148] cdns-csi2rx 30101000.csi-bridge:  Dump DPHY Configure lanes 4
    [  370.665173] cdns-csi2rx 30101000.csi-bridge:  csi2rx_configure_external_dphy ret 0
    [  370.695691] ovt,ox03c 2-0036: INFO:[ov2312_s_stream]:function running
    [  370.702523] j721e-csi2rx 30102000.ticsi2rx: Start DMA: 0 sizeimage 4160000
    <<<<< 2.11 fps
    < 2.31 fps
    <<< 2.55 fps
    <<< 2.66 fps
    <<<< 2.88 fps
    <<<<<<< 3.61 fps
    <<<<< 3.77 fps
    <<<<< 3.97 fps
    <<<< 3.91 fps
    <<< 3.87 fps
    <<<<<< 4.01 fps
    <<< 3.93 fps
    <<< 3.85 fps
    << 3.61 fps
    < 3.58 fps
    <<<< 3.61 fps
    <<<<< 3.69 fps
    <<<<< 3.73 fps
    <<<< 3.73 fps
    <<<< 3.76 fps
    <<< 3.67 fps
    << 3.65 fps
    <<<<< 3.73 fps
    <<<< 3.73 fps
    <<<<< 3.78 fps
    <<<< 3.78 fps
    <<<< 3.81 fps
    <<<< 3.79 fps
    <<< 3.79 fps
    <<<<< 3.80 fps
    <<< 3.77 fps
    <<< 3.76 fps
    <<<<< 3.79 fps
    <<<< 3.81 fps
    

    What is the reason for this phenomenon? Is it because there is something wrong with my format configuration?

    Regards,

    Yuwei

  • Yuwei,

    Do you have same format for both "cdns_csi2rx.30101000.csi-bridge" and "ovt,ox03c 2-0036" now? Can you share the log of "media-ctl -p" again?

    I configured V4L2_CID_PIXEL_RATE in the camera driver and am now able to receive data

    Have you checked the captured images to see if the images looked correct?

    Regards,

    Jianzhong

  • Hi Jianzhong,

    The result of running the "media-ctl -p" command is as follows:

    Media device information
    ------------------------
    driver  [ 1590.437411] INFO [ov2312_get_fmt]:function is running!
            j721e-csi2rx
    model           TI-CSI2RX
    serial
    bus info        platform:30102000.ticsi2rx
    hw revision     0x1
    driver version  5.10.168
    
    Device topology
    - entity 1: 30102000.ticsi2rx (7 pads, 7 links, 1 route)
                type V4L2 subdev subtype Unknown flags 0
                device node name /dev/v4l-subdev0
            routes:
                    0/0 -> 1/0 [ACTIVE]
            pad0: Sink
                    [stream:0 fmt:UYVY8_1X16/1600x1300 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    <- "cdns_csi2rx.30101000.csi-bridge":1 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/1600x1300 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    -> "30102000.ticsi2rx context 0":0 [ENABLED,IMMUTABLE]
            pad2: Source
                    -> "30102000.ticsi2rx context 1":0 [ENABLED,IMMUTABLE]
            pad3: Source
                    -> "30102000.ticsi2rx context 2":0 [ENABLED,IMMUTABLE]
            pad4: Source
                    -> "30102000.ticsi2rx context 3":0 [ENABLED,IMMUTABLE]
            pad5: Source
                    -> "30102000.ticsi2rx context 4":0 [ENABLED,IMMUTABLE]
            pad6: Source
                    -> "30102000.ticsi2rx context 5":0 [ENABLED,IMMUTABLE]
    
    - entity 9: cdns_csi2rx.30101000.csi-bridge (5 pads, 2 links, 0 route)
                type V4L2 subdev subtype Unknown flags 0
                device node name /dev/v4l-subdev1
            pad0: Sink
                    [stream:0 fmt:UYVY8_1X16/1600x1300 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    <- "ovt,ox03c 2-0036":0 [ENABLED,IMMUTABLE]
            pad1: Source
                    [stream:0 fmt:UYVY8_1X16/1600x1300 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
                    -> "30102000.ticsi2rx":0 [ENABLED,IMMUTABLE]
            pad2: Source
                    [stream:0 fmt:UYVY8_1X16/1600x1300 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            pad3: Source
                    [stream:0 fmt:UYVY8_1X16/1600x1300 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
            pad4: Source
                    [stream:0 fmt:UYVY8_1X16/1600x1300 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range]
    
    - entity 15: ovt,ox03c 2-0036 (1 pad, 1 link, 0 route)
                 type V4L2 subdev subtype Sensor flags 0
                 device node name /dev/v4l-subdev2
            pad0: Source
                    [stream:0 fmt:UYVY8_1X16/1600x1300 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range]
                    -> "cdns_csi2rx.30101000.csi-bridge":0 [ENABLED,IMMUTABLE]
    
    - entity 21: 30102000.ticsi2rx context 0 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video2
            pad0: Sink
                    <- "30102000.ticsi2rx":1 [ENABLED,IMMUTABLE]
    
    - entity 27: 30102000.ticsi2rx context 1 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video3
            pad0: Sink
                    <- "30102000.ticsi2rx":2 [ENABLED,IMMUTABLE]
    
    - entity 33: 30102000.ticsi2rx context 2 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video4
            pad0: Sink
                    <- "30102000.ticsi2rx":3 [ENABLED,IMMUTABLE]
    
    - entity 39: 30102000.ticsi2rx context 3 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video5
            pad0: Sink
                    <- "30102000.ticsi2rx":4 [ENABLED,IMMUTABLE]
    
    - entity 45: 30102000.ticsi2rx context 4 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video6
            pad0: Sink
                    <- "30102000.ticsi2rx":5 [ENABLED,IMMUTABLE]
    
    - entity 51: 30102000.ticsi2rx context 5 (1 pad, 1 link, 0 route)
                 type Node subtype V4L flags 0
                 device node name /dev/video7
            pad0: Sink
                    <- "30102000.ticsi2rx":6 [ENABLED,IMMUTABLE]
    
    

    Have you checked the captured images to see if the images looked correct?

    The obtained image is wrong.

    I don't quite understand why the frame rate is not correct. In MIPI protocol, the frame start and frame end are sent separately. Is the frame rate error caused by the am62a chip receiving frequency incorrect?

    It is worth noting that this camera works well on TDA4.

    Are there any other solutions to this problem?

    Regards,

    Yuwei

  • Hi Yuwei,

    I don't quite understand why the frame rate is not correct. In MIPI protocol, the frame start and frame end are sent separately. Is the frame rate error caused by the am62a chip receiving frequency incorrect?

    You're not receiving correct image from the camera. That means the measured frame rate is not reliable.

    I don't see Max9295 and Max96716 in the media pipe. How did you verify both are integrated and configured properly?

    It is worth noting that this camera works well on TDA4.

    Is the sensor driver running in RTOS or Linux on TDA4?

    Regards,

    Jianzhong

  • Hi Jianzhong,

    I don't see Max9295 and Max96716 in the media pipe. How did you verify both are integrated and configured properly?

    This video link (MAX9295,MAX96716,SENSOR) has been verified on the camera verification device, and the camera can produce the picture normally, and you can see that the camera image is correctly captured.

    Is the sensor driver running in RTOS or Linux on TDA4?

    The same video link runing in the RTOS on TDA4.

    Regards,

    Jianzhong

  • This video link (MAX9295,MAX96716,SENSOR) has been verified on the camera verification device

    How did you connect the MAX serdes to AM62A SoC. Are you using SK-AM62A-LP EVM?  

    The same video link runing in the RTOS on TDA4.

    Camera capture SW is very different between RTOS/TDA4 and Linux/AM62A.

  • Hi Jianzhong,

    I have noticed that there is a key parameter 'V4L2_CID_PIXEL_RATE', and the variables related to this parameter are 'link_freq' and 'hs_clk_rate'. Will these two parameters affect the receiving frequency of DPHY? Or will it affect other physical properties of the DPHY?

    Regards,

    Yuwei

  • Hi Yuwei,

    There are two parameters related to link frequency and pixel rate: V4L2_CID_PIXEL_RATE and V4L2_CID_LINK_FREQ. You only need to provide one, ideally link_freq, as it is used to configure the DPHY-RX on the SoC. If link_freq control is missing, then it falls back to pixel_rate to deduce link_freq from it: https://git.ti.com/cgit/ti-linux-kernel/ti-linux-kernel/tree/drivers/media/v4l2-core/v4l2-common.c?h=ti-linux-6.1.y#n450.

    If the link frequency of the DPHY-RX is not configured properly, it could cause no streaming or corrupted data.

    In this earlier ticket opened by Hirain, it seems to me that Hirain had a working solution using the MAX9295/MAX96716 serdes with AM62A EVM. Now you're using a new camera and it's not working. Is that right? If that's the case, you could find the difference between these two cameras and the drivers and see what could be the root cause.

    Regards,

    Jianzhong