6713|1

1

帖子

0

TA的资源

一粒金砂(初级)

楼主
 

imx6q 下使用TW2835视频采集芯片的问题 [复制链接]

请问,基于IMX6Q改的板子,采集芯片使用的TW2835,系统版本为3.0.35,采集芯片接的CSI0。
在board-mx6q_sabresd.c中添加如下代码:

//mclk 感觉没什么用啊
static struct fsl_mxc_camera_platform_data tw2835_data = {
        .core_regulator    = NULL,
        .io_regulator    = NULL,
        .analog_regulator    = NULL,
        .gpo_regulator    = NULL,
        .mclk = 27000000,
        .mclk_source = 0,
        .csi = 0,
        .io_init = mx6q_csi0_io_init,
        .pwdn = mx6q_csi0_cam_powerdown,
};

//使用CSI0
static struct fsl_mxc_capture_platform_data capture_data[] = {
    {
        .csi = 0,
        .ipu = 0,
        .mclk_source = 0,
        .is_mipi = 0,
    }, {
        .csi = 1,
        .ipu = 0,
        .mclk_source = 0,
        .is_mipi = 1,
    },
};

//I2C地址为0x42
static struct i2c_board_info mxc_i2c1_board_info[] __initdata = {
               ...
        {
                I2C_BOARD_INFO("tw2835", 0x42),/*I2C_BOARD_INFO("tw2835", 0x42)*/
                .platform_data = (void *)&tw2835_data,
        },
             ...
}

在board-mx6q_sabresd.h中修改如下代码:
static iomux_v3_cfg_t mx6q_sabresd_csi0_sensor_pads[] = {
    /* IPU1 Camera */
    MX6Q_PAD_CSI0_DAT12__IPU1_CSI0_D_12,
    MX6Q_PAD_CSI0_DAT13__IPU1_CSI0_D_13,
    MX6Q_PAD_CSI0_DAT14__IPU1_CSI0_D_14,
    MX6Q_PAD_CSI0_DAT15__IPU1_CSI0_D_15,
    MX6Q_PAD_CSI0_DAT16__IPU1_CSI0_D_16,
    MX6Q_PAD_CSI0_DAT17__IPU1_CSI0_D_17,
    MX6Q_PAD_CSI0_DAT18__IPU1_CSI0_D_18,
    MX6Q_PAD_CSI0_DAT19__IPU1_CSI0_D_19,
//    MX6Q_PAD_CSI0_DATA_EN__IPU1_CSI0_DATA_EN,
    MX6Q_PAD_CSI0_MCLK__IPU1_CSI0_HSYNC,
    MX6Q_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK,
    MX6Q_PAD_CSI0_VSYNC__IPU1_CSI0_VSYNC,

    MX6Q_PAD_GPIO_0__CCM_CLKO,        /* camera clk */

//    MX6Q_PAD_SD1_DAT0__GPIO_1_16,        /* camera PWDN */
//    MX6Q_PAD_SD1_DAT1__GPIO_1_17,        /* camera RESET */
};

TW2835的源码是参考的网上的一个单片机源码改编的,源码见附件。
我现在的问题是当我使用V4L2采集视频的时候,报的错误是:
ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0
这个错误是因为mxc_v4l2_capture中的camera_callback没有调用么,这个错误应该怎么查呢?
打开V4L2的日志如下:
On Open: Input to ipu size is 720 x 625
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 80685600
   case VIDIOC_QUERYCAP
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c02c5651
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0045627
   case VIDIOC_S_INPUT
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 80085617
   case VIDIOC_G_STD
In mxc_v4l2_g_std
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 40085618
   case VIDIOC_S_STD
In mxc_v4l2_s_std ff
   Setting standard to PAL ff
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c02c563a
   case VIDIOC_CROPCAP
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5616
   case VIDIOC_S_PARM
In mxc_v4l2_s_param
   Current capabilities are 0
   Current capturemode is 0  change to 0
   Current framerate is 50  change to 0
   clock_curr=mclk=0
   g_fmt_cap returns widthxheight of input as 720 x 625
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5605
   case VIDIOC_S_FMT
In MVC: mxc_v4l2_s_fmt
   type=V4L2_BUF_TYPE_VIDEO_CAPTURE
End of mxc_v4l2_s_fmt: v2f pix widthxheight 720 x 576
End of mxc_v4l2_s_fmt: crop_bounds widthxheight 720 x 625
End of mxc_v4l2_s_fmt: crop_defrect widthxheight 720 x 625
End of mxc_v4l2_s_fmt: crop_current widthxheight 720 x 576
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0cc5604
   case VIDIOC_G_FMT
In MVC: mxc_v4l2_g_fmt type=1
   type is V4L2_BUF_TYPE_VIDEO_CAPTURE
End of mxc_v4l2_g_fmt: v2f pix widthxheight 720 x 576
End of mxc_v4l2_g_fmt: crop_bounds widthxheight 720 x 625
End of mxc_v4l2_g_fmt: crop_defrect widthxheight 720 x 625
End of mxc_v4l2_g_fmt: crop_current widthxheight 720 x 576
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0145608
   case VIDIOC_REQBUFS
In MVC:mxc_streamoff
MVC: In mxc_free_frame_buf
In MVC:mxc_allocate_frame_buf - size=829440
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_mmap
   pgoff=0x18a00, start=0x3387f000, end=0x3394a000
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_mmap
   pgoff=0x18300, start=0x33980000, end=0x33a4b000
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445609
   case VIDIOC_QUERYBUF
In MVC:mxc_v4l2_buffer_status
In MVC:mxc_mmap
   pgoff=0x18b00, start=0x33b27000, end=0x33bf2000
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c044560f
   case VIDIOC_QBUF
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c044560f
   case VIDIOC_QBUF
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c044560f
   case VIDIOC_QBUF
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 40085618
   case VIDIOC_S_STD
In mxc_v4l2_s_std ff
   Setting standard to PAL ff
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl 40045612
   case VIDIOC_STREAMON
In MVC:mxc_streamon
In MVC:mxc_v4l_ioctl
In MVC: mxc_v4l_do_ioctl c0445611
   case VIDIOC_DQBUF
In MVC:mxc_v4l_dqueue
ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0
VIDIOC_DQBUF failed.In MVC:mxc_v4l_ioctl

In MVC: mxc_v4l_do_ioctl 40045613
   case VIDIOC_STREAMOFF
In MVC:mxc_streamoff
In MVC:mxc_free_frames
In MVC:mxc_v4l_close
In MVC:mxc_streamoff
mxc_v4l_close: release resource
MVC: In mxc_free_frame_buf
In MVC:mxc_free_frames

TW2835寄存器值:
root@freescale /opt$ ./i2cshow 0  //PAGE 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: 00 08 20 d0 05 20 28 80 80 80 80 82 06 00 11 00
10: 00 08 20 d0 05 20 28 80 80 80 80 82 46 00 11 00
20: 00 08 20 d0 05 20 28 80 80 80 80 82 86 00 11 00
30: 00 08 20 d0 05 20 28 80 80 80 80 82 c6 00 11 00
40: 00 77 77 45 a0 22 2f 64 80 80 82 82 00 0f 05 00
50: 00 80 06 00 40 0f 00 00 00 00 00 00 00 00 00 00
60: 88 88 00 00 10 32 54 76 98 ba dc fe 00 00 88 88
70: 88 54 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 01 7f ff 7f ff 00 ff ff ff ff 31 00 d0 00 20 28
90: 41 7f ff 7f ff 00 ff ff ff ff 71 00 d0 00 20 28
a0: 81 7f ff 7f ff 00 ff ff ff ff b1 00 d0 00 20 28
b0: c1 7f ff 7f ff 00 ff ff ff ff f1 00 d0 00 20 28
c0: 00 00 00 f7 ff 00 f0 ff 00 3c 4f 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 28 00
root@freescale /opt$ ./i2cshow 1  //PAGE 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: 80 02 00 00 0f 84 00 00 00 00 20 d7 23 2d 1e a7
10: 80 02 00 00 02 00 10 00 81 02 00 01 02 00 11 00
20: 82 02 00 02 02 00 12 00 83 02 00 03 02 00 13 00
30: 00 5a 00 48 5a b4 00 48 00 5a 48 90 5a b4 48 90
40: 78 b4 30 60 00 3c 60 90 3c 78 60 90 78 b4 60 90
50: 28 00 10 a0 0f 00 40 03 00 00 00 00 00 00 20 a7
60: 80 02 00 81 02 00 82 02 00 83 02 00 00 e4 00 00
70: 00 03 00 01 23 00 02 00 0f 0f 0f 0f f0 00 8b 04
80: df 00 91 07 eb 10 a8 00 80 c7 80 00 c0 c1 c2 c3
90: 00 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00
a0: 66 32 97 00 80 20 00 0c 20 4c aa 70 40 40 00 00
b0: 00 00 eb 00 ff 00 ff 0f 0f 00 00 00 00 00 00 00
c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
root@freescale /opt$ ./i2cshow 2  //PAGE 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00: 00 00 00 00 00 50 59 00 35 03 60 e1 00 94 0d 0f
10: f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
20: 00 b0 00 00 00 00 40 00 00 00 00 00 00 b0 00 00
30: 00 00 40 00 00 00 00 00 00 00 00 00 00 00 00 00
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50: 00 00 00 00 00 00 00 00 00 00 00 40 40 40 42 ff
60: 00 00 00 00 00 00 fb 00 00 00 00 00 00 00 fb 00
70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
80: 17 73 88 4a 07 24 00 00 00 00 00 00 00 00 00 00
90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0f 00
a0: 17 73 88 4a 07 24 00 00 00 00 00 00 00 00 00 00
b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0f 00
c0: 17 73 88 4a 07 24 00 00 00 00 00 00 00 00 00 00
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0f 00
e0: 17 73 88 4a 07 24 00 00 00 00 00 00 00 00 00 00
f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0f 00

请各位大神帮帮忙,我的问题出在哪里啊?是TW2835的寄存器设置有问题还是ARM这边的IPU CSI配置有问题?

TW2835SpecV1.2.pdf

3.76 MB, 下载次数: 6

tw2835手册

此帖出自ARM技术论坛

最新回复

楼主问题解决了吗? 我使用的视频解码芯片是类似的tw8836,不过我的IMX6只有CIS0 的 MX6Q_PAD_CSI0_DAT12__IPU1_CSI0_D_12,      MX6Q_PAD_CSI0_DAT13__IPU1_CSI0_D_13,      MX6Q_PAD_CSI0_DAT14__IPU1_CSI0_D_14,      MX6Q_PAD_CSI0_DAT15__IPU1_CSI0_D_15,      MX6Q_PAD_CSI0_DAT16__IPU1_CSI0_D_16,      MX6Q_PAD_CSI0_DAT17__IPU1_CSI0_D_17,      MX6Q_PAD_CSI0_DAT18__IPU1_CSI0_D_18,      MX6Q_PAD_CSI0_DAT19__IPU1_CSI0_D_19,      MX6Q_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK, 这几个接口和8836相接,(8836的i2c 接口与另外一个mcu相连,用mcu进行配置它,而且确定8826的数据和时钟都有数据输出了) imx6这边的驱动只负责收数据,但是按着你的方式改动了一下,还是timeout en_counter0这个错误,楼主有什么方法解决吗?我的是不是由于callback函数没触发导致的啊   详情 回复 发表于 2016-11-3 14:51
点赞 关注
 

回复
举报

1

帖子

0

TA的资源

一粒金砂(初级)

沙发
 
楼主问题解决了吗? 我使用的视频解码芯片是类似的tw8836,不过我的IMX6只有CIS0 的
MX6Q_PAD_CSI0_DAT12__IPU1_CSI0_D_12,
     MX6Q_PAD_CSI0_DAT13__IPU1_CSI0_D_13,
     MX6Q_PAD_CSI0_DAT14__IPU1_CSI0_D_14,
     MX6Q_PAD_CSI0_DAT15__IPU1_CSI0_D_15,
     MX6Q_PAD_CSI0_DAT16__IPU1_CSI0_D_16,
     MX6Q_PAD_CSI0_DAT17__IPU1_CSI0_D_17,
     MX6Q_PAD_CSI0_DAT18__IPU1_CSI0_D_18,
     MX6Q_PAD_CSI0_DAT19__IPU1_CSI0_D_19,
     MX6Q_PAD_CSI0_PIXCLK__IPU1_CSI0_PIXCLK,
这几个接口和8836相接,(8836的i2c 接口与另外一个mcu相连,用mcu进行配置它,而且确定8826的数据和时钟都有数据输出了) imx6这边的驱动只负责收数据,但是按着你的方式改动了一下,还是timeout en_counter0这个错误,楼主有什么方法解决吗?我的是不是由于callback函数没触发导致的啊
此帖出自ARM技术论坛
 
 
 

回复
您需要登录后才可以回帖 登录 | 注册

随便看看
查找数据手册?

EEWorld Datasheet 技术支持

相关文章 更多>>
关闭
站长推荐上一条 1/8 下一条

 
EEWorld订阅号

 
EEWorld服务号

 
汽车开发圈

About Us 关于我们 客户服务 联系方式 器件索引 网站地图 最新更新 手机版

站点相关: 国产芯 安防电子 汽车电子 手机便携 工业控制 家用电子 医疗电子 测试测量 网络通信 物联网

北京市海淀区中关村大街18号B座15层1530室 电话:(010)82350740 邮编:100190

电子工程世界版权所有 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号 Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved
快速回复 返回顶部 返回列表