Difference between revisions of "Camera interface"

From ArmadeusWiki
Jump to: navigation, search
m (Driver)
(Test)
 
(23 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Under_Construction}}
 
 
 
On this page you will find useful informations on how to use the Camera/CMOS Sensor Interface (CSI) of the i.MX chip found on your APF board.
 
On this page you will find useful informations on how to use the Camera/CMOS Sensor Interface (CSI) of the i.MX chip found on your APF board.
Currently only the i.MX27/APF27 are supported.
+
Currently only the [[APF27]] & [[APF6]] are supported.
  
 
==Hardware==
 
==Hardware==
* All the signals of the i.MX27 CSI interface can be found on the J9 connector of the APF27Dev development board.
+
===APF27===
* You should connect an external camera compatible with the CSI interface (8bits) to see something ;-). Here are the tested models:
+
* All the signals of the i.MX27 CSI interface can be found on the J9 connector of the [[APF27Dev|APF27Dev development board]].
** [[OV9653]] (Omnivision sensor found in the 22T1 module from Microjet; no more available for sale :-()
+
* You should connect an external camera/sensor compatible with the CSI interface (8bits data bus) to see something ;-). Here are the tested sensor models:
 +
** [[OV9653]] / [[OV9655]]
 +
** [[OV7670]]
 +
** [[OV3640]]
 +
* All these sensors are controllable through an I2C interface. The one on J8 connector of [[APF27Dev]] can for example be used.
 +
 
 +
===APF6===
 +
* [[APF6Dev]] boards have a wandcam (OV5640) compatible connector (near the PCIexpress one).
 +
* MIPI bus is used on [[APF6Dev]]
  
 
==Driver==
 
==Driver==
* CSI interface can be driven through the V4L2 (Video For Linux) standard interface. To activate it you have to:
+
* From now we consider that you have a supported camera module plugged on your development board
<pre class="host">
+
* CSI interface can be driven through the V4L2 (Video For Linux) standard interface as soon as CSI/MIPI driver is loaded:
$ make linux26-menuconfig
+
{| border="1" cellpadding="10" cellspacing="0" summary="Camera drivers" class="wikitable"
 +
|- style="background:#efefef;" align="center"
 +
! APF27 || APF6 (kernel 3.19+)
 +
|---
 +
|<pre class="apf">
 +
# modprobe mx27_camera
 
</pre>
 
</pre>
<pre class="config"
+
* Then you have to load your camera driver in order for him to "attach" to the CSI one (for example for the OV9653):
Device Drivers  --->
+
<pre class="apf">
    Multimedia devices --->
+
  # modprobe ov96xx
        <M> Video For Linux
+
        ...
+
        [*] Video capture adapters  --->
+
            ...
+
            -M-  SoC camera support
+
            ...
+
            <M>  i.MX27 Quick Capture Interface driver
+
 
</pre>
 
</pre>
 
+
|
 
<pre class="apf">
 
<pre class="apf">
# modprobe mx27_camera
+
# modprobe -a mx6-camera mipi-csi2 ov5640-mipi
 
</pre>
 
</pre>
 +
|}
 +
 +
 +
* Now it's up to you to configure your camera with the tools/API the camera driver is offering...
 +
 +
==Test==
 +
* We have a small SDL/V4L2 app to quickly test that your camera is working properly (you will also need a LCD interface): ''target/demos/camera/capture/''
 +
** it may be installed by default on your rootfs depending on your Buildroot defconfig.
 +
** to launch it (here to have a 640x480 camera image on a LW700 TFT):
 +
<pre class=apf>
 +
# capture --width 640 --height 480 --cam_width 640 --cam_height 480
 +
</pre>
 +
 +
* To trigger autofocus (APF6 with 3.19+ kernel):
 +
<pre class=apf>
 +
# v4l2-ctl -c auto_focus_start=1
 +
</pre>
 +
 +
==Going further==
 +
* [[Using the i.MX27 video codec|Using the i.MX27 video codec]]
 +
 +
==Links==
 +
* [http://linux.bytesex.org/v4l2/ Video4Linux]
 +
 +
[[Category:Vision]]

Latest revision as of 15:54, 1 April 2016

On this page you will find useful informations on how to use the Camera/CMOS Sensor Interface (CSI) of the i.MX chip found on your APF board. Currently only the APF27 & APF6 are supported.

Hardware

APF27

  • All the signals of the i.MX27 CSI interface can be found on the J9 connector of the APF27Dev development board.
  • You should connect an external camera/sensor compatible with the CSI interface (8bits data bus) to see something ;-). Here are the tested sensor models:
  • All these sensors are controllable through an I2C interface. The one on J8 connector of APF27Dev can for example be used.

APF6

  • APF6Dev boards have a wandcam (OV5640) compatible connector (near the PCIexpress one).
  • MIPI bus is used on APF6Dev

Driver

  • From now we consider that you have a supported camera module plugged on your development board
  • CSI interface can be driven through the V4L2 (Video For Linux) standard interface as soon as CSI/MIPI driver is loaded:
APF27 APF6 (kernel 3.19+)
# modprobe mx27_camera
  • Then you have to load your camera driver in order for him to "attach" to the CSI one (for example for the OV9653):
 # modprobe ov96xx
# modprobe -a mx6-camera mipi-csi2 ov5640-mipi


  • Now it's up to you to configure your camera with the tools/API the camera driver is offering...

Test

  • We have a small SDL/V4L2 app to quickly test that your camera is working properly (you will also need a LCD interface): target/demos/camera/capture/
    • it may be installed by default on your rootfs depending on your Buildroot defconfig.
    • to launch it (here to have a 640x480 camera image on a LW700 TFT):
# capture --width 640 --height 480 --cam_width 640 --cam_height 480
  • To trigger autofocus (APF6 with 3.19+ kernel):
# v4l2-ctl -c auto_focus_start=1

Going further

Links