This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

No MT9T031 chip detected, register read ffffff87

Other Parts Discussed in Thread: THS7303, TVP7002, THS7353, PCA9543A

嗨喽,我有一个DM368的开发板,使用的sensor为MT9P031。

我有将内核make menuconfig 里的其他解码器去掉。选中MT9P031

有在static struct vpfe_subdev_info vpfe_sub_devs[] 添加

.module_name = "mt9p031",
.is_camera = 1,
.grp_id = VPFE_SUBDEV_MT9P031,
.num_inputs = ARRAY_SIZE(mt9p031_inputs),
.inputs = mt9p031_inputs,
.ccdc_if_params = {
.if_type = VPFE_RAW_BAYER,
.hdpol = VPFE_PINPOL_POSITIVE,
.vdpol = VPFE_PINPOL_POSITIVE,
},
.board_info = {
I2C_BOARD_INFO("mt9p031", 0x5d),
/* this is for PCLK rising edge */
.platform_data = (void *)1,
},
},

我的bootargs为

setenv bootargs dm365_imp.oper_mode=0 mem=48M console=ttyS0,115200n8 noinitrd rw ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs video=davincifb:osd0=720x480x16,4050K davinci_capture.device_type=4;

现在内核启动信息出现问题为:

i2c /dev entries driver
Linux video capture interface: v2.00
ths7303 1-002c: chip found @ 0x58 (DaVinci I2C adapter)
ths7303 1-002c: ths7303 write failed
ths7303: probe of 1-002c failed with error -121
vpfe_init
vpfe-capture: vpss clock vpss_master enabled
vpfe-capture vpfe-capture: v4l2 device registered
vpfe-capture vpfe-capture: video device registered
EVM: switch to tvp7002 HD video input
vpfe-capture vpfe-capture: v4l2 sub device ths7353 register fails
dm365evm_enable_pca9543a
dm365evm_enable_pca9543a, status = -121
EVM: switch to HD imager video input
mt9p031 1-0055: No MT9P031 chip detected, register read ffffff87
vpfe-capture vpfe-capture: v4l2 sub device mt9p031 register fails
No sub devices registered
vpfe-capture: vpfe capture clocks disabled
vpfe_register_ccdc_device: DM365 ISIF
dm365_isif: probe of dm365_isif failed with error -22

请问该如何解决呢?

  • 你好,

    建议使用IPNC的软件。对RAW输入支持更好。

  • 恩,这个是我基于以前同事的基础上改的,他之前有什么添加改动我没法乱改。  IPNC可以作为实验测试。
    现在我这个MT9P031 出现的问题是怎么造成的的呢?该怎么解决?谢谢了。

  •  DVSDK 4.02 存在MT9P031传感器的驱动吗? 
      你能给我个明确的答案吗? 
    还有如果不存在? 那个 kernel/drivers/media/video/mt9p031.c 这个文件是什么作用呢?
  • Juke,

    能否修改davinci_capture.device_type=3,再试试?

    http://processors.wiki.ti.com/index.php/U-Boot_Usage

    davinci_capture.device_type=
    This defines which driver to use. Use the following settings:
    davinci_capture.device_type=0 for MT9T001
    davinci_capture.device_type=1 for TVP5146
    davinci_capture.device_type=2 for MT9T031
    davinci_capture.device_type=3 for MT9P031
    davinci_capture.device_type=4 for TVP7002
  • 我将 davinci_capture.device_type=3 for MT9P031 还是不行的。
    就是检测不到MT9P031芯片。 而且没有/dev/video0设备节点。 我使用i2c工具 i2cdetect -y 1   也没有检测到 0x5d的设备地址。
  • Juke,

    EVM上是没有MT9P031sensor的,你是外部接了一个sensor到板子上么?

  • 这是我的板卡。  我是自己制作了一块MT9P031 sensor的板卡,拆了一个旧的摄像头。 

  • Juke,

    你使用的不是TI的DM36x EVM。

    能否尝试vpfe_capture.interface=1?

    https://e2e.ti.com/support/embedded/linux/f/354/p/184033/664906#664906

  •  嗨 

    还是不行的,我的I2C设备地址 为0x5d。这点我确认的。

    我的内核启动信息

    Environment size: 588/131068 bytes
    DM368 >> bootm
    ## Booting kernel from Legacy Image at 80700000 ...
    Image Name: Linux-2.6.32.17-davinci1
    Created: 2016-03-28 10:25:58 UTC
    Image Type: ARM Linux Kernel Image (uncompressed)
    Data Size: 2239208 Bytes = 2.1 MiB
    Load Address: 80008000
    Entry Point: 80008000
    Verifying Checksum ... OK
    Loading Kernel Image ... OK
    OK

    Starting kernel ...

    Uncompressing Linux.................................................................................................................................................. done, booting the kernel.
    Linux version 2.6.32.17-davinci1 (root@zslf-desktop) (gcc version 4.3.3 (Sourcery G++ Lite 2009q1-203) ) #140 PREEMPT Mon Mar 28 18:25:50 CST 2016
    CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
    CPU: VIVT data cache, VIVT instruction cache
    Machine: DaVinci DM36x EVM
    Memory policy: ECC disabled, Data cache writeback
    DaVinci dm36x_rev1.2 variant 0x8
    Built 1 zonelists in Zone order, mobility grouping off. Total pages: 12192
    Kernel command line: dm365_imp.oper_mode=0 mem=48M console=ttyS0,115200n8 noinitrd rw ubi.mtd=3 root=ubi0:rootfs rootfstype=ubifs video=davincifb:osd0=720x480x16,4050K davinci_capture.device_type=3 vpfe_capture.interface=1
    PID hash table entries: 256 (order: -2, 1024 bytes)
    Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
    Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
    Memory: 48MB = 48MB total
    Memory: 43916KB available (4204K code, 392K data, 144K init, 0K highmem)
    SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    Hierarchical RCU implementation.
    NR_IRQS:245
    Calibrating delay loop... 147.86 BogoMIPS (lpj=739328)
    Mount-cache hash table entries: 512
    CPU: Testing write buffer coherency: ok
    DaVinci: 8 gpio irqs
    NET: Registered protocol family 16
    davinci_serial_init:97: failed to get UART2 clock
    EVM: HD imager video input
    bio: create slab <bio-0> at 0
    DM365 IPIPE initialized in Continuous mode
    SCSI subsystem initialized
    usbcore: registered new interface driver usbfs
    usbcore: registered new interface driver hub
    usbcore: registered new device driver usb
    pca9543a_probe
    vpss vpss: dm365_vpss vpss probed
    vpss vpss: dm365_vpss vpss probe success
    dm365_afew_hw_init
    lconfig->line_length is 0.
    ch0 default output "COMPOSITE", mode "NTSC"
    ###### vpbe_encoder_init ######
    ###### vid_enc_register_encoder ######
    ###### mgr->num_encoders is 0 ######
    ###### **ch_id is 0 ######
    ###### mode_info.name is NTSC ######
    ###### vpbe_encoder_initialize ######
    ###### output is COMPOSITE,outindex is 0 ######
    ###### vpbe_encoder_setoutput ######
    ###### dm365 = 1 ######
    ###### mode_info->std is 1 ######
    ###### mode is NTSC ######
    ###### 22VPBE Encoder initialized ######
    ###### vpbe_encoder_setoutput ######
    ###### dm365 = 1 ######
    ###### mode_info->std is 1 ######
    ###### mode is NTSC ######
    ###### dm365 = 1 ######
    ###### mode_info->std is 1 ######
    ###### mode is NTSC ######
    ###### 33encoder->mode_ops->setmode: error is 0 ######
    ###### davinci_enc_set_mode_platform : next davinci_enc_priv_setmode ######
    VPBE Encoder Initialized
    ###### 11VPBE Encoder Initialized ######
    Switching to clocksource timer0_1
    musb_hdrc: version 6.0, cppi-dma, host, debug=0
    musb_hdrc: USB Host mode controller at fec64000 using DMA, IRQ 12
    musb_hdrc musb_hdrc: MUSB HDRC host driver
    musb_hdrc musb_hdrc: new USB bus registered, assigned bus number 1
    usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    usb usb1: Product: MUSB HDRC host driver
    usb usb1: Manufacturer: Linux 2.6.32.17-davinci1 musb-hcd
    usb usb1: SerialNumber: musb_hdrc
    usb usb1: configuration #1 chosen from 1 choice
    hub 1-0:1.0: USB hub found
    hub 1-0:1.0: 1 port detected
    NET: Registered protocol family 2
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    TCP established hash table entries: 2048 (order: 2, 16384 bytes)
    TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
    TCP: Hash tables configured (established 2048 bind 2048)
    TCP reno registered
    NET: Registered protocol family 1
    RPC: Registered udp transport module.
    RPC: Registered tcp transport module.
    RPC: Registered tcp NFSv4.1 backchannel transport module.
    Installing knfsd (copyright (C) 1996 okir@monad.swb.de).
    msgmni has been set to 85
    alg: No test for stdrng (krng)
    io scheduler noop registered
    io scheduler anticipatory registered (default)
    ###### davinci_enc_get_mode ######
    ###### davinci_get_cur_encoder ######
    ###### davinci_enc_get_mode ######
    ###### davinci_get_cur_encoder ######
    ###### davinci_enc_get_mode ######
    ###### davinci_get_cur_encoder ######
    davincifb davincifb.0: dm_osd0_fb: 720x480x16@0,0 with framebuffer size 4050KB
    davincifb davincifb.0: dm_vid0_fb: 0x0x16@0,0 with framebuffer size 1020KB
    ###### davinci_enc_get_mode ######
    ###### davinci_get_cur_encoder ######
    ###### davinci_enc_get_mode ######
    ###### davinci_get_cur_encoder ######
    davincifb davincifb.0: dm_osd1_fb: 720x480x4@0,0 with framebuffer size 675KB
    davincifb davincifb.0: dm_vid1_fb: 0x0x16@0,0 with framebuffer size 1020KB
    DM365 IPIPEIF probed
    imp serializer initialized
    davinci_previewer initialized
    davinci_resizer initialized
    davinci gpio led module init .......
    register davinci gpio module is ok .......
    Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
    serial8250.0: ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A
    console [ttyS0] enabled
    serial8250.0: ttyS1 at MMIO 0x1d06000 (irq = 41) is a 16550A
    brd: module loaded
    NAND device: Manufacturer ID: 0xec, Chip ID: 0xdc (Samsung NAND 512MiB 3,3V 8-bit)
    nand_bbt: ECC error while reading bad block table
    Creating 5 MTD partitions on "davinci_nand.0":
    0x000000000000-0x0000003c0000 : "bootloader"
    0x0000003c0000-0x000000400000 : "params"
    0x000000400000-0x000000820000 : "kernel"
    0x000000820000-0x000008820000 : "filesystem"
    0x000008820000-0x000020000000 : "zslf"
    davinci_nand davinci_nand.0: controller rev. 2.3
    UBI: attaching mtd3 to ubi0
    UBI: physical eraseblock size: 131072 bytes (128 KiB)
    UBI: logical eraseblock size: 126976 bytes
    UBI: smallest flash I/O unit: 2048
    UBI: VID header offset: 2048 (aligned 2048)
    UBI: data offset: 4096
    UBI: attached mtd3 to ubi0
    UBI: MTD device name: "filesystem"
    UBI: MTD device size: 128 MiB
    UBI: number of good PEBs: 1024
    UBI: number of bad PEBs: 0
    UBI: max. allowed volumes: 128
    UBI: wear-leveling threshold: 4096
    UBI: number of internal volumes: 1
    UBI: number of user volumes: 1
    UBI: available PEBs: 5
    UBI: total number of reserved PEBs: 1019
    UBI: number of PEBs reserved for bad PEB handling: 10
    UBI: max/mean erase counter: 3/1
    UBI: image sequence number: 0
    UBI: background thread "ubi_bgt0d" started, PID 345
    PPP generic driver version 2.4.2
    PPP Deflate Compression module registered
    PPP BSD Compression module registered
    PPP MPPE Compression module registered
    NET: Registered protocol family 24
    tun: Universal TUN/TAP device driver, 1.6
    tun: (C) 1999-2004 Max Krasnyansky <maxk@qualcomm.com>
    usbcore: registered new interface driver cdc_ether
    console [netcon0] enabled
    netconsole: network logging started
    Initializing USB Mass Storage driver...
    usbcore: registered new interface driver usb-storage
    USB Mass Storage support registered.
    usbcore: registered new interface driver usbserial
    USB Serial support registered for generic
    usbcore: registered new interface driver usbserial_generic
    usbserial: USB Serial Driver core
    USB Serial support registered for GSM modem (1-port)
    usbcore: registered new interface driver option
    option: v0.7.2:USB Driver for GSM modems
    usbcore: registered new interface driver usbtest
    rtc-ds1307 1-0068: rtc core: registered ds1339 as rtc0
    i2c /dev entries driver
    Linux video capture interface: v2.00
    ths7303 1-002c: chip found @ 0x58 (DaVinci I2C adapter)
    ths7303 1-002c: ths7303 write failed
    ths7303: probe of 1-002c failed with error -121
    vpfe_init
    vpfe-capture: vpss clock vpss_master enabled
    vpfe-capture vpfe-capture: v4l2 device registered
    vpfe-capture vpfe-capture: video device registered
    dm365evm_enable_pca9543a
    dm365evm_enable_pca9543a, status = -121
    EVM: switch to HD imager video input
    mt9p031 1-005d: No MT9P031 chip detected, register read ffffff87
    vpfe-capture vpfe-capture: v4l2 sub device mt9p031 register fails
    No sub devices registered
    vpfe-capture: vpfe capture clocks disabled
    vpfe_register_ccdc_device: DM365 ISIF
    dm365_isif: probe of dm365_isif failed with error -22
    af major#: 250, minor# 0
    AF Driver initialized
    aew major#: 249, minor# 0
    AEW Driver initialized
    ###### osd_init ######
    ### VPBE OSD DRIVER INIT ###
    Trying to register davinci display video device.
    layer=c10ac800,layer->video_dev=c10ac970
    Trying to register davinci display video device.
    layer=c10acc00,layer->video_dev=c10acd70
    davinci_init:DaVinci V4L2 Display Driver V1.0 loaded
    watchdog watchdog: heartbeat 60 sec
    davinci_mmc davinci_mmc.0: Using DMA, 4-bit mode
    Advanced Linux Sound Architecture Driver Version 1.0.21.
    No device for DAI tlv320aic3x
    No device for DAI davinci-i2s
    asoc: tlv320aic3x <-> davinci-i2s mapping ok
    ALSA device list:
    #0: DaVinci EVM (tlv320aic3x)
    TCP cubic registered
    NET: Registered protocol family 17
    Clocks: disable unused mmcsd1
    Clocks: disable unused spi0
    Clocks: disable unused spi1
    Clocks: disable unused spi2
    Clocks: disable unused spi3
    Clocks: disable unused spi4
    Clocks: disable unused pwm0
    Clocks: disable unused pwm1
    Clocks: disable unused pwm2
    Clocks: disable unused pwm3
    Clocks: disable unused timer1
    Clocks: disable unused timer3
    Clocks: disable unused emac
    Clocks: disable unused voice_codec
    Clocks: disable unused rto
    Clocks: disable unused mjcp
    davinci_emac_probe: using random MAC addr: 52:17:f2:8d:64:fe
    emac-mii: probed
    mmc0: new high speed SDHC card at address e624
    rtc-ds1307 1-0068: setting system clock to 2011-06-06 21:31:18 UTC (1307395878)
    mmcblk0: mmc0:e624 SU64G 59.4 GiB
    mmcblk0: p1
    UBIFS: mounted UBI device 0, volume 0, name "rootfs"
    UBIFS: file system size: 126341120 bytes (123380 KiB, 120 MiB, 995 LEBs)
    UBIFS: journal size: 6348800 bytes (6200 KiB, 6 MiB, 50 LEBs)
    UBIFS: media format: w4/r0 (latest is w4/r0)
    UBIFS: default compressor: lzo
    UBIFS: reserved for root: 4952683 bytes (4836 KiB)
    VFS: Mounted root (ubifs filesystem) on device 0:14.
    Freeing init memory: 144K
    INIT: version 2.86 booting
    Please wait: booting...
    Error Cannot open /dev/tty0: No such device or address
    Starting udev
    FAT: bogus number of reserved sectors
    VFS: Can't find a valid FAT filesystem on dev mmcblk0.
    EXT3-fs warning: maximal mount count reached, running e2fsck is recommended
    kjournald starting. Commit interval 5 seconds
    EXT3 FS on mmcblk0p1, internal journal
    EXT3-fs: mounted filesystem with writeback data mode.
    Root filesystem already rw, not remounting
    Caching udev devnodes
    Populating dev cachemv: cannot rename '/tmp/devices': No such file or directory
    ALSA: Restoring mixer settings...
    Configuring network interfaces... eth0: attached PHY driver [LXT971] (mii_bus:phy_addr=1:01, id=1378e2)
    done.
    Setting up IP spoofing protection: rp_filter.
    INIT: Entering runlevel: 5
    Starting system message bus: dbus.
    Starting telnet daemon.
    Starting syslogd/klogd: done
    CMEMK module: built on Mar 16 2016 at 16:05:03
    Reference Linux version 2.6.32
    File /home/zslf/dm368/dvsdk_dm368_4_02_00_06/linuxutils_2_26_01_02/packages/ti/sdo/linuxutils/cmem/src/module/cmemk.c
    allocated heap buffer 0xc7000000 of size 0x4400000
    heap fallback enabled - will try heap if pool buffer is not available
    CMEM Range Overlaps Kernel Physical - allowing overlap
    CMEM phys_start (0x1000) overlaps kernel (0x80000000 -> 0x83000000)
    cmemk initialized
    IRQK module: built on Mar 16 2016 at 16:07:13
    Reference Linux version 2.6.32
    File /home/zslf/dm368/dvsdk_dm368_4_02_00_06/linuxutils_2_26_01_02/packages/ti/sdo/linuxutils/irq/src/module/irqk.c
    PHY: 1:01 - Link is Up - 100/Full
    irqk initialized
    EDMAK module: built on Mar 16 2016 at 16:06:27
    Reference Linux version 2.6.32
    File /home/zslf/dm368/dvsdk_dm368_4_02_00_06/linuxutils_2_26_01_02/packages/ti/sdo/linuxutils/edma/src/module/edmak.c
    ############## ZSLF ##################
    start copy the config file from zslf to thttpd/www.
    Create a shared memory segment 32769.
    6 Jun 21:31:37 ntpdate[1022]: no server suitable for synchronization found
    mkdir: cannot create directory '/media/mmcblk0p1/bak': File exists
    ## davinci_pio_led:ioctl:out: GPIO-81=1 now.ret= 0 ##
    setrlimit ok
    FD_SETSIZE= 1024
    ######## encode #########
    ### timenow->tm_year = 111 ###

    _____ _____ _ _
    | _ |___ ___ ___ ___ | _ |___ ___ |_|___ ___| |_
    | | _| .'| . | . | | __| _| . | | | -_| _| _|
    |__|__|_| |__,|_ |___| |__| |_| |___|_| |___|___|_|
    |___| |___|

    Arago Project http://arago-project.org dm368-evm ttyS0

    Arago 2011.02 dm368-evm ttyS0

    dm368-evm login: root

  • Juke,

    感觉可能是sensor板的问题。你能否测量一下sensor板上的时钟等信号是否都正常?如果正常,测量一下I2C上的信号。

  • 因为sensor板不是我设计的哈。我想问一下,MT9P031正常的EXTCLK   和 PCLK 这两个时钟应该是多少Mhz的呢? 

    我们这个sensor板硬件设计的有问题。 现在解决情况是 EXTCLK 引脚外接的27Mhz有源晶振。   经测量PCLK也为27Mhz。 

    但是我 看相关资料。都是EXTCLK 接的是DM368的时钟输出引脚,为24Mhz的。

    这跟我现在出现的问题有关吗?

  • JUKE CHEN 说:

    我们这个sensor板硬件设计的有问题。 现在解决情况是 EXTCLK 引脚外接的27Mhz有源晶振。   经测量PCLK也为27Mhz。 

    但是我 看相关资料。都是EXTCLK 接的是DM368的时钟输出引脚,为24Mhz的。

    EXTCLK这个时钟输入可以是DM36x的时钟输出,或者是其他时钟源。

    请你们sensor板设计的MT9P031的VDD_IO是1.8V还是2.8V?MT9P031的I2C时钟和数据线上是否有上拉电阻?


  • MT9P031的VDD_IO 是2.8V ,  i2c的 时钟线和数据线是有上拉电阻的,为 2.2K的上拉电阻。

  • Juke,

    量一下sensor侧I2C的信号吧,看看是否是正确的?

  • Chris Meng


    我正打算,测量I2C信号。 但是现在遇到一个问题。 

    我不知道怎么测I2C信号。。。  我的意思不是说我不会使用示波器测波形。

    DM368 和 MT9P031 是通过I2C 通信吧。 它也只是上电的某个瞬间发送一个设备地址吧, 但是他不是一直都有数据传输的,我没法测它的波形。

    而是我现在没有 让I2C 一直通信可以测波形的应用程序的 demo。

    你能告诉我一个 I2C 测试应用程序 demo 吗?  新手勿喷。。。


    还有 我发现一问题,我之前的内核,至少还有 /dev/video0   

    i2cdetect -l    可以发现有i2c-1  我只使用了一个i2c总线

    i2cdetect -y 1  也可以看到 0x5d 设备地址UU。


    但是我现在的内核 没有 /dev/video0 设备节点  也有没I2C 的 0x5d设备地址。

  • Chris Meng 

    我测试了I2C信号。 时钟线是有的周期为2.5us 。但是数据线没有信号。

    而我使用i2c tools查看我的i2c设备 ,也没有发现MT9P031的设备地址0x5d啊。

    我怀疑是不是内核是不是没有注册上呢?

    我不知道驱动还需要怎么处理了? 请给我些建议吧。

     

  • 问题已经找到,是硬件设计问题。谢谢 Chris Meng