Porting ov2740 camera sensor on imx93 #171047
Replies: 2 comments 9 replies
-
|
From your description, the hang at VIDIOC_STREAMON is usually caused by a mismatch between your MIPI CSI2/ISI configuration or incorrect PLL / clock settings for the camera. Things to check / try:
Also:
|
Beta Was this translation helpful? Give feedback.
3 replies
-
|
Hi, did you manage to fix that issue? If possible, may I ask how you resolved the problem? |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment



Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Copilot Feature Area
General
Body
I am trying to operate an OV2740 camera module on the IMX93 FRDM board.
And when I am trying to capture a frame, the v4l2-ctl hangs :
root@imx93frdm:~# v4l2-ctl -d /dev/video0 --set-fmt-video=width=1932,height=1092,pixelformat=BA10 --stream-mmap=4 --stream-count=1 --stream-to=test_capture.raw --verbose
VIDIOC_QUERYCAP: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture Multiplanar:
Width/Height : 1932/1092
Pixel Format : 'BA10' (10-bit Bayer GRGR/BGBG)
Field : None
Number of planes : 1
Flags :
Colorspace : sRGB
Transfer Function : Default
YCbCr/HSV Encoding: ITU-R 601
Quantization : Full Range
Plane 0 :
Bytes per Line : 3864
Size Image : 4219488
VIDIOC_REQBUFS returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_G_FMT returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_STREAMON returned 0 (Success)
The media graph looks to be ok :
root@imx93frdm:~# media-ctl -p
Media controller API version 6.6.36
Media device information
driver mxc-md
model FSL Capture Media Device
serial
bus info platform:42800000.bus:camera
hw revision 0x0
driver version 6.6.36
Device topology
entity 1: mxc_isi.0 (16 pads, 2 links, 0 routes)
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
<- "ov2740 2-0036":0 [ENABLED,IMMUTABLE]
pad1: Sink
pad2: Sink
pad3: Sink
pad4: Source
-> "mxc_isi.0":0 [ENABLED]
pad5: Source
pad6: Source
pad7: Source
entity 31: ov2740 2-0036 (1 pad, 1 link, 0 routes)
type V4L2 subdev subtype Sensor flags 0
device node name /dev/v4l-subdev1
pad0: Source
[stream:0 fmt:SGRBG10_1X10/1932x1092 field:none
crop.bounds:(0,0)/1932x1092
crop:(0,0)/1932x1092]
-> "mxc-mipi-csi2.0":0 [ENABLED,IMMUTABLE]
My DTS :
&clk {
assigned-clocks = <&clk IMX93_CLK_CCM_CKO3>;
assigned-clock-parents = <&clk IMX93_CLK_24M>;
assigned-clock-rates = <24000000>;
};
ov2740_mipi: ov2740_mipi@36{
compatible = "ovti,ov2740";
reg = <0x36>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_cam_mclk>;
clocks = <&clk IMX93_CLK_CCM_CKO3>;
assigned-clocks = <&clk IMX93_CLK_CCM_CKO3>;
assigned-clock-rates = <24000000>;
clock-names = "xclk";
clock-frequency = <24000000>;
reset-gpios = <&pcal6524 22 GPIO_ACTIVE_LOW>;
csi_id = <0>;
mipi_csi;
rotation = <0>;
orientation = <2>;
status = "okay";
port {
ov2740_mipi_ep: endpoint {
remote-endpoint = <&mipi_csi_in_ep>;
bus-type = <4>;
data-lanes = <1 2>;
clock-noncontinuous;
link-frequencies = /bits/ 64 <360000000>;
};
};
&cameradev {
status = "okay";
};
&isi_0 {
status = "okay";
cap_device {
status = "okay";
};
};
&mipi_csi {
status = "okay";
fsl,rx-lanes = <2>;
csis-hs-settle = <16>;
/* Port 0: sink from the sensor */
port@0 {
reg = <0>;
mipi_csi_in_ep: endpoint {
remote-endpoint = <&ov2740_mipi_ep>;
data-lanes = <2>;
cfg-clk-range = <28>;
hs-clk-range = <0x16>;
bus-type = <4>;
clock-noncontinuous;
};
};
};
The driver is the ov2740 driver from the linux-imx scargapth. I modified it to match the DT, and I changed the PLL configuration to match a 24MHz clock :
Here is the camera data sheet:
www.elinfor.com/pdf/OmniVision/OV2740-OmniVision.pdf
Note that my module regulators are connected to the 3.3 volt; because of this, I didn't define regulators in the DTS
I based my changes on the driver from:
https://github.com/6by9/linux/tree/rpi-6.1.y-ov2740
Any advice
BR
Basel
Beta Was this translation helpful? Give feedback.
All reactions