OV5640 camera on i.MX93 can not work on some resolution

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OV5640 camera on i.MX93 can not work on some resolution

1,644 Views
wenxue_guo
Contributor III

Hi,

I'm debugging our OV5640 camera module on our new i.MX93 board with BSP version LF-6.1.22-2.0.0, it works fine on our some other boards based on i.MX8MN, i.MX8MM, i.MX8MQ, i.MX8ULP.

 

Refer to this post About settings to operate ov5640 camera on i.MX93EVK, it works on resolutions 1920x1080, 640x480, 320x240..., but can not work on 2592x1944, 1280x720, 1024x768, 720x480. Attachment is the capture images with those resolutions.

 

root@maaxboardosm93:~# v4l2-ctl -d0 --list-framesizes YUYV
ioctl: VIDIOC_ENUM_FRAMESIZES
        Size: Discrete 160x120
        Size: Discrete 176x144
        Size: Discrete 320x240
        Size: Discrete 640x480
        Size: Discrete 720x480
        Size: Discrete 720x576
        Size: Discrete 1024x768
        Size: Discrete 1280x720
        Size: Discrete 1920x1080
        Size: Discrete 2592x1944

 

 

Below is our DTS configuration for MIPI-CSI and image sensor.

 

 

/ {
... ...
    /* It's a 25MHz crystal oscillator on OV5640 camera board */
    cam_xtal: cam-xtal {
        compatible = "fixed-clock";
        #clock-cells = <0>;
        clock-frequency = <25000000>;
        clock-output-names = "cam_xtal";
    };  
... ...
};

&lpi2c5 {
... ...

    ov5640_mipi: ov5640_mipi@3c {
        compatible = "ovti,ov5640";
        reg = <0x3c>;
        clocks = <&cam_xtal>;
        clock-names = "xclk";
        powerdown-gpios = <&ioexpander1 6 GPIO_ACTIVE_LOW>;
        reset-gpios = <&ioexpander1 7 GPIO_ACTIVE_LOW>;
        status = "okay";

        port {
            ov5640_mipi_ep: endpoint {
                remote-endpoint = <&mipi_csi_ep>;
                data-lanes = <2>;
                cfg-clk-range = <28>;
                hs-clk-range = <0x16>;
            };
        };
    };
};

&epxp {
    status = "okay";
};

&media_blk_ctrl {
    status = "okay";
};

&cameradev {
    status = "okay";
};

&isi_0 {
    status = "okay";

    cap_device {
        status = "okay";
    };
};

&mipi_csi {
    #address-cells = <1>;
    #size-cells = <0>;
    status = "okay";

    port@0 {
        reg = <0>;
        mipi_csi_ep: endpoint {
            remote-endpoint = <&ov5640_mipi_ep>;
            data-lanes = <2>;
            cfg-clk-range = <28>;
            hs-clk-range = <0x16>;
            bus-type = <4>;
        };
    };
};

 

 

Can anyone give us some guide to support all those resolutions ? Thanks in advanced! 

 

0 Kudos
6 Replies

531 Views
yukmr
Contributor I

Is this problem solved? I'm facing same problem with same environment.

0 Kudos

1,394 Views
deepakbeniya
Contributor III

Same error I am getting in Android 11 , imx8mm 
Camera - OV5640 MIPI-CSI
Display - 6 Inch MIPI-DSI 

How to solve this ?
@joanxie please post the solution here.That will be usefull for others also.

0 Kudos

1,627 Views
joanxie
NXP TechSupport
NXP TechSupport

what command do you use to capture these picture? what do you get when you use command " media-ctl -p“

 

 

 

0 Kudos

1,621 Views
wenxue_guo
Contributor III

Hi @joanxie 

Thanks for your reply! Below is the "media-ctl -p"  command output:

root@maaxboardosm93:~# media-ctl -p
Media controller API version 6.1.22

Media device information
------------------------
driver          mxc-md
model           FSL Capture Media Device
serial          
bus info        platform:42800000.bus:camera
hw revision     0x0
driver version  6.1.22

Device topology
- entity 1: mxc_isi.0 (16 pads, 2 links)
            type V4L2 subdev subtype Unknown flags 0
        pad0: Sink
                <- "mxc-mipi-csi2.0":4 [ENABLED]
        pad1: Sink
        pad2: Sink
        pad3: Sink
        pad4: Sink
        pad5: Sink
        pad6: Sink
        pad7: Sink
        pad8: Sink
        pad9: Sink
        pad10: Sink
        pad11: Sink
        pad12: Source
                -> "mxc_isi.0.capture":0 [ENABLED]
        pad13: Source
        pad14: Source
        pad15: Sink

- entity 18: mxc_isi.0.capture (1 pad, 1 link)
             type Node subtype V4L flags 0
             device node name /dev/video0
        pad0: Sink
                <- "mxc_isi.0":12 [ENABLED]

- entity 22: mxc-mipi-csi2.0 (8 pads, 2 links)
             type Node subtype V4L flags 0
             device node name /dev/v4l-subdev0
        pad0: Sink
                <- "ov5640 4-003c":0 [ENABLED,IMMUTABLE]
        pad1: Sink
        pad2: Sink
        pad3: Sink
        pad4: Source
                -> "mxc_isi.0":0 [ENABLED]
        pad5: Source
        pad6: Source
        pad7: Source

- entity 31: ov5640 4-003c (1 pad, 1 link)
             type V4L2 subdev subtype Sensor flags 0
             device node name /dev/v4l-subdev1
        pad0: Source
                [fmt:UYVY8_1X16/160x120@1/15 colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range
                 crop.bounds:(0,0)/2624x1964
                 crop:(16,14)/2592x1944]
                -> "mxc-mipi-csi2.0":0 [ENABLED,IMMUTABLE]

 

And I use "gst-launch-1.0"  command  to capture images, and below is my capture shell script.

#!/bin/bash

WORK_PATH=/tmp
IMG_PRFIX=capture_

# Check support resolutions: v4l2-ctl -d0 --list-framesizes YUYV
 width=(2592 1920 1280 1024 720 720 640 320 176 160)
height=(1944 1080 720  768  576 480 480 240 144 120)
nums=${#width[@]}

cd $WORK_PATH

rm -f ${IMG_PRFIX}*.jpg

for ((i = 0; i < nums; i++)); do
    w=${width[i]}
    h=${height[i]}

    echo ""
    echo "Capture ${w}x${h} jpg image"
    gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=1 ! video/x-raw,format=YUY2,width=${w},height=${h} ! jpegenc ! filesink location=${IMG_PRFIX}${w}x${h}.jpg
done

sz ${IMG_PRFIX}*.jpg

 

0 Kudos

1,594 Views
joanxie
NXP TechSupport
NXP TechSupport

I have mailed to you, pls check it

0 Kudos

1,213 Views
deepakbeniya
Contributor III

@joanxie @wenxue_guo 
mail me too , I am also facing the same problem.

0 Kudos