移植ov5640到imx8M mini

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

移植ov5640到imx8M mini

3,860 Views
xcyhere
Contributor I

你好:

         我目前使用的是开发板信息:Linux imx8mmevk 4.14.98+,目前需要移植ov5640摄像头,项目硬件连接与评估板唯一不同的地方:评估板控制接口连接I2C3,我现在连接的是I2C4,其他不变:

pastedImage_1.png

pastedImage_2.png

因此,我只是将设备树中描述ov5640节点从i2c3整体挪到i2c4下,并且加入对reset复位引脚描述

pastedImage_3.png

出现两个问题:

(1)ov5640驱动使用drivers/media/platform/mxc/capture/ov5640_mipi_v2.c代码和ov5640_mipi.c 有什么区别呢

(2)开发板执行:gst-launch-1.0 v4l2src ! video/x-raw,format=YUY2,width=1920,height=1080 ! queue max-size-time=0 ! waylandsink enable-tile=true sync=false 报错

pastedImage_4.png

0 Kudos
6 Replies

3,494 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi xcy,

>>(1)ov5640驱动使用drivers/media/platform/mxc/capture/ov5640_mipi_v2.c代码和ov5640_mipi.c 有什么区别呢

---ov5640_mipi.c is used for I.MX6 & I.MX7 EVK board.

---ov5640_mipi_v2.c is used for i.MX8 serials EVK board.

From the functions of 2 sets of source code for ov5640,  there is no fundamental difference between them. Your board is based on i.MX8M Mini processor, so ov5640_mipi_v2.c should be used.

>>(2)开发板执行:gst-launch-1.0 v4l2src ! video/x-raw,format=YUY2,width=1920,height=1080 ! queue max-size-time=0 ! waylandsink enable-tile=true sync=false 报错

---first, you can check if camera adapter board has been connected to your board. J802 connector is for camera adapter board.

--- If above adapter board has been connected, after system booting, you check if  /dev/video0 has been created by linux driver.

Hope above information is helpful for you!

Have a nice day!

BR,

Weidong

0 Kudos

3,494 Views
xcyhere
Contributor I

你好:

         (1)相机在上电之前已经连接到底板上

         (2)无论相机是否接入开发板,在/dev/video0设备节点都存在

         (3)在/sys/class/i2c-adapter/i2c-3/3-003c,已经出现camera设备

0 Kudos

3,494 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hi xcy,

(1)i.MX8M Mini EVK上的camera图像显示

    你使用的命令没有问题,我核对过你的命令,并在论坛里找到一个客户使用相同命令,可以正常显示图像的:

https://community.nxp.com/message/1122444?commentID=1122444#comment-1122444 

# gst-launch-1.0 v4l2src ! video/x-raw,format=YUY2,width=1920,height=1080 ! queue max-size-time=0 ! waylandsink enable-tile=true sync=false

下面是一个使用i.MX8M Mini的命令格式:

pastedImage_3.png

(2) 关于你更换了I2C4的问题

在默认的BSP device tree里,I2C4被配置成了2个GPIO,你移植的时候,不要忘记把这2个复用的位置注释掉。同时,把I2C4引脚的复用,放到原来I2C3的复用位置。

其他的地方,倒是没有什么要注意的地方了。

Have a nice day!

BR,

weidong

0 Kudos

3,494 Views
xcyhere
Contributor I

你好:

      我现在做了一下确认:

      (1)I2C4引脚确认修改:

pastedImage_2.png

      (2)I2C已经工作:能够使用i2c读取并打印ov5640的chip_id

      (3)ov5640已经正常复位上电:能够读写ov5640寄存器

      (4)我根据V4L2应用框架编写了应用测试程序,来读取当前摄像机支持的信息,发现不能得到当前相机的格式信息:

pastedImage_1.png

0 Kudos

3,494 Views
jianfeichang
Contributor IV

你好,现在我入手imx8mm 使用的和你一样,用的是ov5640 mipi 接口,也是使用的I2C4,使用gst-launch-1.0测试是没有问题的,然后我用V4L2程序测序,也是没有问题的。希望对你有帮助

0 Kudos

3,494 Views
weidong_sun
NXP TechSupport
NXP TechSupport

Hello xcy,

     i.MX8M MINI 上的camera 驱动部分,分为:ov5640和capture 两个部分。ov5640部分就是ov5640_mipi_v2.c,而CPU端捕获部分是mx6s_capture.c(这个文件里是i.MX8M MINI端MIPI CSI-2捕获端),你可以在这里跟踪一下相关的信息。

    另外,在我们的linux BSP,提供了一个mxc_v4l2_capture 测试程序代码,你可以参考它来编写你自己的应用。

还有就是我们linux BSP document中,有一个 reference manuanl,这里也介绍了v4l2怎么用。

-------------

Camera driver on i.MX8M MINI is divided into two parts: ov5640 and capture. The ov5640 part is ov5640_mipi_v2.c, and the CPU capture part is mx6s_capture.c (in this file is the i.MX8M MINI MIPI CSI-2 capture end), where you can trace the relevant information.


In addition, in our Linux BSP, we provide a mxc_v4l2_capture test program code, you can refer to it to write your own application.
Also, in our Linux BSP document, there is a reference manuanl, which also describes how to use v4l2.

-------------

Have a nice day!

Weidong

0 Kudos