imx8mm raw10 ar0234 1920x1200 30fps 4lanes 10bit 获取raw图像异常

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

imx8mm raw10 ar0234 1920x1200 30fps 4lanes 10bit 获取raw图像异常

1,257 Views
zjf_leopard
Contributor I

修改的文件:

imx8mm-var-dart.dts:

&csi1_bridge {
fsl,mipi-mode;
fsl,two-8bit-sensor-mode;
status = "okay";
port {
csi1_ep: endpoint {
remote-endpoint = <&csi1_mipi_ep>;
};
};
};

&mipi_csi_1 {
#address-cells = <1>;
#size-cells = <0>;
status = "okay";
port {
mipi1_sensor_ep: endpoint@1 {
remote-endpoint = <&ov5640_mipi1_ep>;
data-lanes = <4>;//<2>;
csis-hs-settle = <19>;//<13>;
csis-clk-settle = <0>;//<2>;
csis-wclk;
};

csi1_mipi_ep: endpoint@2 {
remote-endpoint = <&csi1_ep>;
};
};
};

mx6s_capture.c:

static struct mx6s_fmt formats[] = {
{
.name = "RAWRGB10 (SGRBG10)",
.fourcc = V4L2_PIX_FMT_SGRBG10,
.pixelformat = V4L2_PIX_FMT_SGRBG10,
.mbus_code = MEDIA_BUS_FMT_SGRBG10_1X10,
.bpp = 2,
}, {
.name = "UYVY-16",
.fourcc = V4L2_PIX_FMT_UYVY,
.pixelformat = V4L2_PIX_FMT_UYVY,
.mbus_code = MEDIA_BUS_FMT_UYVY8_2X8,
.bpp = 2,
}, {
.name = "YUYV-16",
.fourcc = V4L2_PIX_FMT_YUYV,
.pixelformat = V4L2_PIX_FMT_YUYV,
.mbus_code = MEDIA_BUS_FMT_YUYV8_2X8,
.bpp = 2,
}, {
.name = "YUV32 (X-Y-U-V)",
.fourcc = V4L2_PIX_FMT_YUV32,
.pixelformat = V4L2_PIX_FMT_YUV32,
.mbus_code = MEDIA_BUS_FMT_AYUV8_1X32,
.bpp = 4,
}, {
.name = "RAWRGB8 (SBGGR8)",
.fourcc = V4L2_PIX_FMT_SBGGR8,
.pixelformat = V4L2_PIX_FMT_SBGGR8,
.mbus_code = MEDIA_BUS_FMT_SBGGR8_1X8,
.bpp = 1,
}
};

+++++++++++++++++++++++++++++++++++++++++++

case V4L2_PIX_FMT_YUV32:
case V4L2_PIX_FMT_SBGGR8:
case V4L2_PIX_FMT_SGRBG10:
J_DEBUG
width = pix->width*2;
break;
case V4L2_PIX_FMT_UYVY:

+++++++++++++++++++++++++++++++++++++

case V4L2_PIX_FMT_SBGGR8:
cr18 |= BIT_MIPI_DATA_FORMAT_RAW8;
break;
case V4L2_PIX_FMT_SGRBG10://RAW10
J_DEBUG
cr18 |= BIT_MIPI_DATA_FORMAT_RAW10;
break;

+++++++++++++++++++++++++++++++++++++++++++++++++++

mxc_mipi_csi.c

static const struct csis_pix_format mipi_csis_formats[] = {
{
.code = MEDIA_BUS_FMT_SGRBG10_1X10,
.fmt_reg = MIPI_CSIS_ISPCFG_FMT_RAW10,
.data_alignment = 16,
}, {
.code = MEDIA_BUS_FMT_YUYV8_2X8,
.fmt_reg = MIPI_CSIS_ISPCFG_FMT_YCBCR422_8BIT,
.data_alignment = 16,
}, {
.code = MEDIA_BUS_FMT_VYUY8_2X8,
.fmt_reg = MIPI_CSIS_ISPCFG_FMT_YCBCR422_8BIT,
.data_alignment = 16,
}, {
.code = MEDIA_BUS_FMT_SBGGR8_1X8,
.fmt_reg = MIPI_CSIS_ISPCFG_FMT_RAW8,
.data_alignment = 8,
}
};

抓图命令:

yavta.out -c10 -p -fSGRBG10 -s 1920x1200 -t 1/30 -F/home/root/output.raw /dev/video0

现象:

驱动是基于ov5640_mipi_v2.c改的,添加打印信息,mx6s_capture.c static irqreturn_t mx6s_csi_irq_handler(int irq, void *data) 这个这个中断似乎没有触发,但是sensor mipi信号是有的, 获取不到图像。请问我是漏掉了什么吗, 我应该从哪里开始排查?

谢谢

0 Kudos
Reply
3 Replies

1,233 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi zjf_leopard ,

i.MX8MM内部没有ISP模块,无法对RAW data进行格式转换。因此,即使MIPI CSI-2能够接受到来自camera RAW data,也是无法在屏幕上显示出来。具体的方案,必须要这样做:

1. 电路上camera with RAW data --->ISP 芯片(YUV输出/RGBA)----->I.MX8MM MIPI CSI-2

或者

2. camera with RAW data --->I.MX8MM MIPI CSI-2(自己写软件ISP转成YUV格式/RGBA格式)并显示图像

[注]

虽然我们提供softISP,但是i.MX8MM不支持它。具体的情况你可以参考这里:

https://www.nxp.com/design/designs/i-mx8-software-image-signal-processing:SOFTISP-I.MX8

 

Hope above information is helpful to you.

Have a nice day!

B.R

Weidong

0 Kudos
Reply

1,232 Views
zjf_leopard
Contributor I

Hi weidong_sun

感谢您的回复, 我们暂时不需要在屏幕上显示,只需要可以抓到原始数据,可以放到PC机上去转换。

现在遇到的问题是:

 在mx6s_capture.c里加了debug信息,

static irqreturn_t mx6s_csi_irq_handler(int irq, void *data)
{
struct mx6s_csi_dev *csi_dev = data;
unsigned long status;
u32 cr3, cr18;

spin_lock(&csi_dev->slock);

status = csi_read(csi_dev, CSI_CSISR);
printk("csi status: **** %lx ****\n", status);
csi_write(csi_dev, status, CSI_CSISR);
printk("csi status: **** %lx ****\n", status);

......

发现CSI_CSISR状态寄存器读出来的值是:

[ 36.831848] jason debug: func: mx6s_csi_irq_handler *** line: 1118
[ 36.838115] csi status: **** ffffffff80014000 ****
[ 36.842903] csi status: **** ffffffff80014000 ****
[ 36.858187] jason debug: func: mx6s_csi_irq_handler *** line: 1118
[ 36.864456] csi status: **** ffffffff80014001 ****
[ 36.869245] csi status: **** ffffffff80014001 ****
[ 37.319816] jason debug: func: mx6s_csi_irq_handler *** line: 1118
[ 37.326091] csi status: **** ffffffff92034001 ****
[ 37.330879] csi status: **** ffffffff92034001 ****
[ 37.335667] jason debug: func: mx6s_csi_irq_handler *** line: 1147
[ 37.709196] jason debug: func: mx6s_csi_irq_handler *** line: 1118
[ 37.715468] csi status: **** ffffffff80014001 ****
[ 37.720257] csi status: **** ffffffff80014001 ****
[ 38.616861] jason debug: func: mx6s_csi_irq_handler *** line: 1118
[ 38.623132] csi status: **** ffffffff80014001 ****
[ 38.627920] csi status: **** ffffffff80014001 ****
[ 38.651299] jason debug: func: mx6s_csi_irq_handler *** line: 1118
[ 38.657566] csi status: **** ffffffff90214001 ****
[ 38.662353] csi status: **** ffffffff90214001 ****
好像是BIT_ADDR_CH_ERR_INT (0x1 << 28)异常, 暂时还没排查出是哪里的问题, 请帮忙看下, 谢谢

0 Kudos
Reply

1,103 Views
link
Contributor III

您,请问您这个问题解决了吗,我这边也遇到了与您相同的问题,能否说一下问题原因,感谢。

0 Kudos
Reply