IMX8MP: Cant get data from IMX385 sensor

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

IMX8MP: Cant get data from IMX385 sensor

2,563 Views
Egor-G
Contributor I

Hello. I'm trying to get data from Sony IMX385 sensor, connected to CSI of IMX8MP. I modified similar IMX290 driver to setup sensor ( I also tryied ready IMX385 drivers found on github). I also modified imx8-isi-cap.c and imx8-isi-fmt.c to enable RAW12 format. I added 

{
.name = "SRGGB12",
.fourcc = V4L2_PIX_FMT_SRGGB12,
.depth = { 16 },
.color = MXC_ISI_OUT_FMT_RAW12,
.memplanes = 1,
.colplanes = 1,
.mbus_code = MEDIA_BUS_FMT_SRGGB12_1X12,
.align = 3,
},

in mxc_isi_out_formats[] and 

{
.name = "SRGGB12",
.fourcc = V4L2_PIX_FMT_SRGGB12,
.depth = { 16 },
.memplanes = 1,
.colplanes = 1,
.align = 2,
},

in mxc_isi_src_formats[], and changed *mxc_isi_get_src_fmt function to:

struct mxc_isi_fmt *mxc_isi_get_src_fmt(struct v4l2_subdev_format *sd_fmt)
{
u32 index;

/* two fmt RGB32 and YUV444 from pixellink */
if (sd_fmt->format.code == MEDIA_BUS_FMT_YUYV8_1X16 ||
sd_fmt->format.code == MEDIA_BUS_FMT_YVYU8_2X8 ||
sd_fmt->format.code == MEDIA_BUS_FMT_AYUV8_1X32 ||
sd_fmt->format.code == MEDIA_BUS_FMT_UYVY8_2X8 ||
sd_fmt->format.code == MEDIA_BUS_FMT_YUYV8_2X8)
index = 1;
else if(sd_fmt->format.code == MEDIA_BUS_FMT_SRGGB12_1X12)
index = 2;
else
index = 0;
return &mxc_isi_src_formats[index];
}

Camera connected to CSI1: 

&i2c5 {
clock-frequency = <100000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c5>;
status = "okay";

imx385: imx385_mipi@1a {
compatible = "sony,imx385";
reg = <0x1a>;
//pwn-gpios = <&gpio4 4 GPIO_ACTIVE_HIGH>;
rst-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>;
clocks = <&cam_clk>;
clock-names = "xclk";
clock-frequency = <37125000>;
status = "okay";

port {
imx385_mipi_1_ep: endpoint {
remote-endpoint = <&mipi_csi1_ep>;
data-lanes = <1 2>;
clock-lanes = <0>;
link-frequencies = /bits/ 64 <445500000>;
};
};
};
};

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

port@1 {
reg = <1>;
mipi_csi1_ep: endpoint {
remote-endpoint = <&imx385_mipi_1_ep>;
data-lanes = <2>;
csis-hs-settle = <13>;
csis-clk-settle = <2>;
csis-wclk;
};
};
};

&isi_0 {
status = "okay";
interface =3 0 2>;

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

&isi_1 {
interface = <2 0 2>;
};

&cameradev {
status = "okay";
};

Dmesg output:

mx8-img-md: Registered mxc_isi.0.capture as /dev/video0
mx8-img-md: Registered sensor subdevice: imx385 4-001a (1)
mx8-img-md: created link [mxc_isi.0] => [mxc_isi.0.capture]
mx8-img-md: created link [mxc-mipi-csi2.1] => [mxc_isi.0]
mx8-img-md: created link [imx385 4-001a] => [mxc-mipi-csi2.1]
mxc-md 32c00000.bus:camera: mxc_md_create_links

When I call:

v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG12 --stream-mmap --stream-to=/tmp/test --verbose

I get:

VIDIOC_QUERYCAP: ok
VIDIOC_G_FMT: ok
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_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_STREAMON returned 0 (Success)

bypass csc
input fmt RG12
output fmt RG12

But no data get from the sensor. Or, sometimes some bytes going from sensor but fps is too slow:

cap dqbuf: 0 seq: 1 bytesused: 4147200 ts: 183.157053 (ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 2 bytesused: 4147200 ts: 245.397292 delta: 62240.239 ms (ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 3 bytesused: 4147200 ts: 275.897113 delta: 30499.821 ms (ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 4 bytesused: 4147200 ts: 316.563648 delta: 40666.535 ms (ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 5 bytesused: 4147200 ts: 321.925278 delta: 5361.630 ms fps: 0.03 (ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 6 bytesused: 4147200 ts: 347.049312 delta: 25124.034 ms fps: 0.03 (ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 7 bytesused: 4147200 ts: 353.731482 delta: 6682.170 ms fps: 0.04 (ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 8 bytesused: 4147200 ts: 357.212745 delta: 3481.263 ms fps: 0.04 (ts-monotonic, ts-src-eof)

 

Could you help me to find the problem

0 Kudos
Reply
8 Replies

2,184 Views
Egor-G
Contributor I

So... solved...

0 Kudos
Reply

2,399 Views
Egor-G
Contributor I

IMX385 is very similar to IMX290. IS there someone who have working IMX290 on IMX8MP? There is imx290 driver in kernel tree and also there is a modified version for raspberry pi.

0 Kudos
Reply

2,376 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @Egor-G,


I hope you are doing well.

Q) Does someone have really working drivers (imx290.c, imx8-isi-cap.c, imx8-csi2-sam.c and etc) even for IMX290 sensor? It looks like some configuration is wrong.
-> If it seems configuration problem, One should use the latest BSP version to have updated drivers as well as firmware, Please check the same with the latest Linux BSP.

Q) IMX385 is very similar to IMX290. IS there someone who have working IMX290 on IMX8MP? There is imx290 driver in kernel tree and also there is a modified version for raspberry pi.
-> One can get this modified driver in the latest BSP at the below-given location for Sony IMX290 CMOS Image Sensor Driver.
<Linux_src_code>/drivers/media/i2c/imx290.c

I hope this information helps!

Thanks & Regards,
Dhruvit Vasavada

0 Kudos
Reply

2,467 Views
Egor-G
Contributor I

Does someone know Is IMX8MP ISI and ISP accept RAW10/RAW12 packed format? In isp-vvcam/src/vvcam/v4l2/video/video.c defined only not packed formats

0 Kudos
Reply

2,450 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @Egor-G,

I hope you are doing well.

Q)Is IMX8MP ISI and ISP accept RAW10/RAW12 packed format?
->The chip(8mp) supports two 4-lane MIPI CSI2 camera input.
->When used in conjunction with output to the ISP, the RAW8, RAW10, RAW12, and RAW14 image formats are supported.

Thanks & Regards,
Dhruvit Vasavada

0 Kudos
Reply

2,469 Views
Egor-G
Contributor I

Nothing works. Still no any data. I checked all connection and rewrite driver for raspberry pi. On raspberry pi camera send data, on IMX8 nothing with same driver.

0 Kudos
Reply

2,523 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @Egor-G,

I hope you are doing well.

->Please make sure of the connection.
->Please try to capture the image by given below command.

v4l2-ctl --device /dev/video0 --set-fmtvideo=width=2688,height=1520,pixelformat=BG10
v4l2-ctl --device /dev/video0 --stream-mmap --stream-to=frame.raw --stream-count=1

->Please set the format, resolution, pixel, etc.. as per requirements.

I hope this may help!

Thanks & Regards,
Dhruvit Vasavada

0 Kudos
Reply

2,401 Views
Egor-G
Contributor I

I ckecked all connection - ok. Does someone have really working drivers (imx290.c, imx8-isi-cap.c, imx8-csi2-sam.c and etc) even for IMX290 sensor? It looks like some configuration is wrong.

0 Kudos
Reply