Camera (IMX219) with MIPI-CSI on efus

  • Camera (IMX219) with MIPI-CSI on efus carrier board with EFUSA9-V4-LIN


    Hi,


    im trying to get an IMX219 Camera (Raspberry-Pi-Camera version 2.1) to work on an efus carrier board with EFUSA9-V4-LIN.


    The camera is connected to the board via MIPI-CSI2 and I was provided with a Yocto-OS / image where it should work, but as it does not im trying to find the error(s) can you help me here?


    Yocto's iMX Camera App does not list any devices, but there is a video0 found by video for linux (v4l2):

    root@fsimx6:~# v4l2-ctl --list-devices

    DISP3 BG ():

    /dev/video16

    /dev/video17

    Failed to open /dev/video0: Resource temporarily unavailable


    video0 should be my (non-working) IMX219 camera?



    From my understanding, I need a MIPI-CSI driver, a driver for the specific camera and driver for v4l2 for the camera to work and it has to be registered in the device tree...


    With dmesg I can find a MIPI-CSI driver and something for v4l2, but nothing for the camera device:

    dmesg | grep mipi

    [ 0.320704] mxc_mipi_csi2 21dc000.mipi_csi: i.MX MIPI CSI2 driver probed

    [ 0.320718] mxc_mipi_csi2 21dc000.mipi_csi: i.MX MIPI CSI2 dphy version is 0x

    dmesg | grep v4l2

    [ 1.807139] mxc_v4l2_output v4l2_out: V4L2 device registered as video16

    [ 1.812636] mxc_v4l2_output v4l2_out: V4L2 device registered as video17

    dmesg | grep imx2

    [ 1.819655] imx2-wdt 20bc000.wdog: timeout 60 sec (nowayout=0)


    So this means I have an MIPI-CSI2 driver, but am missing an input driver for v4l2 and a driver for the specific camera altogether?


    Also, is there an easy way to look at the device tree from the command line? (As the camera should be listed there?)


    Best Regards,

    Markus

  • Hi,


    sorry for late response.


    video0 should be my (non-working) IMX219 camera?

    I am not sure if it is video0 you also have video16 and video17.


    From my understanding, I need a MIPI-CSI driver, a driver for the specific camera and driver for v4l2 for the camera to work and it has to be registered in the device tree...

    Thats correct I can confirm that the MIPI-CSI driver and the driver for v4l2 should work. We have tested that with a camera from OmniVision.


    Do you have added the driver for your camera into the kernel or is it already integrated?


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hi,


    thanks for your help!


    I am not sure if it is video0 you also have video16 and video17.

    v4l2 tells me that video16 and video17 are "Not a video capture device." I can still record videos/pictures using them, which are then showing screen-captures.


    Do you have added the driver for your camera into the kernel or is it already integrated?

    I'm not sure, how can I test that? (As stated, I was provided with an OS-Image, I did not create it myself.)


    I have however found something else by chance. After using v4l2 to list the devices, I suddenly find error messages in the dmesg output. Does this tell you anything?:

    root@fsimx6:~# dmesg | grep v4l2

    [ 1.807171] mxc_v4l2_output v4l2_out: V4L2 device registered as video16

    [ 1.812677] mxc_v4l2_output v4l2_out: V4L2 device registered as video17

    root@fsimx6:~# v4l2-ctl --list-devices

    DISP3 BG ():

    /dev/video16

    /dev/video17

    Failed to open /dev/video0: Resource temporarily unavailable

    root@fsimx6:~# dmesg | grep v4l2

    [ 1.807171] mxc_v4l2_output v4l2_out: V4L2 device registered as video16

    [ 1.812677] mxc_v4l2_output v4l2_out: V4L2 device registered as video17

    [ 64.681672] ERROR: v4l2 capture: slave not found!

    [ 64.686784] ERROR: v4l2 capture: slave not found!


    Best Regards,

    Markus

  • You also have to make sure whether the board is configured for MIPI-CSI or Parallel CSI. As you can see from this table...


    https://www.fs-net.de/de/produkte/efus/efusa9/#panel-2


    ...both variants are possible.


    If you were provided with the OS-Image, then you have to ask those people, who have prepared it, if a driver for this camera is included. By default, we only have one Omnivision camera included, and if this is not your camera model, and you have only an F&S standard image, then the driver for your camera is most probably not included.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

  • Hi,


    thanks for your lead!


    I've found the address of IOMUXC_GPR1 (containing MIPI_IPU2_MUX / MIPI_IPU1_MUX / IPU_VPU_MUX bits) in http://cache.freescale.com/fil…c/ref_manual/IMX6DQRM.pdf


    I've tried reading/writing the registers with devmem2. It seems IPU1 is selected and set to MIPI, while IPU2 is set to parallel for some reason. (Default would be 0 (MIPI) for MIPI_IPU2_MUX-bit if I understand the aforementioned document correctly.)

    I set both bits to select IPU2 and set it to MIPI, but this seems to have no effect.

    Does changing those registers even work after booting? Because they are reset after reboot.


    devmem2 0x20e0004

    /dev/mem opened.

    Memory mapped at address 0x76f62000.

    Read at address 0x020E0004 (0x76f62004): 0x48601005


    devmem2 0x20e0004 w 0x48401005

    /dev/mem opened.

    Memory mapped at address 0x76f2f000.

    Read at address 0x020E0004 (0x76f2f004): 0x48601005

    Write at address 0x020E0004 (0x76f2f004): 0x48401005, readback 0x48401005


    devmem2 0x20e0004 w 0x48421005

    /dev/mem opened.

    Memory mapped at address 0x76fc9000.

    Read at address 0x020E0004 (0x76fc9004): 0x48401005

    Write at address 0x020E0004 (0x76fc9004): 0x48421005, readback 0x48421005


    Best regards,

    Markus

  • I believe you are on the wrong track. The option to have MIPI-CSI or Parallel CSI is a hardware option! if you have a board configured for Parallel CSI, then the camera signals are simply not connected to the MIPI pins on the CPU. So even if the driver was available, it would not work.


    Regarding the driver, it needs a file similar to


    drivers/media/platform/mxc/capture/ov5640_mipi.c


    What you have is the generic capture infrastructure on MXC, the MIPI sub-infrastructure to the capture infrastructure and the V4L2 view to the capture infrastructure. But do you also have the camera driver that links into the MIPI infrastructure? If there is no similar file for your camera, then you simply do not have the camera driver itself.


    Your F&S Support Team

    F&S Elektronik Systeme GmbH
    As this is an international forum, please try to post in English.
    Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.