<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wikilegacy.armadeus.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=SebT</id>
	<title>ArmadeusWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wikilegacy.armadeus.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=SebT"/>
	<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=Special:Contributions/SebT"/>
	<updated>2026-04-27T23:04:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>http://wikilegacy.armadeus.com/index.php?title=Camera_interface&amp;diff=15166</id>
		<title>Camera interface</title>
		<link rel="alternate" type="text/html" href="http://wikilegacy.armadeus.com/index.php?title=Camera_interface&amp;diff=15166"/>
		<updated>2025-08-14T19:10:36Z</updated>

		<summary type="html">&lt;p&gt;SebT: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;On this page you will find useful informations on how to use the Camera/CMOS Sensor Interface (CSI/CSI2) of the i.MX chip found on your APF and OPOS93Dev board.&lt;br /&gt;
Currently only the [[APF27]], [[APF6]] &amp;amp; [[OPOS93]] are supported.&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
===APF27===&lt;br /&gt;
* All the signals of the i.MX27 CSI interface can be found on the J9 connector of the [[APF27Dev|APF27Dev development board]].&lt;br /&gt;
* You should connect an external camera/sensor compatible with the CSI interface (8bits data bus) to see something ;-). Here are the tested sensor models:&lt;br /&gt;
** [[OV9653]] / [[OV9655]]&lt;br /&gt;
** [[OV7670]]&lt;br /&gt;
** [[OV3640]]&lt;br /&gt;
* All these sensors are controllable through an I2C interface. The one on J8 connector of [[APF27Dev]] can for example be used.&lt;br /&gt;
&lt;br /&gt;
===APF6===&lt;br /&gt;
* [[APF6Dev]] boards have a wandcam (OV5640) compatible connector (near the PCIexpress one).&lt;br /&gt;
* MIPI bus is used on [[APF6Dev]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===OPOS93===&lt;br /&gt;
* The [[OPOS93DEV]] board has a 15-pin Raspberry Pi Camera compatible connector (located below the OPOS93 SoC).&lt;br /&gt;
* A 2-lane MIPI CSI-2 bus is used.&lt;br /&gt;
* Tested with the OmniVision OV5647 sensor.&lt;br /&gt;
&lt;br /&gt;
==Driver==&lt;br /&gt;
* From now we consider that you have a supported camera module plugged on your development board&lt;br /&gt;
* CSI interface can be driven through the V4L2 (Video For Linux) standard interface as soon as CSI/MIPI driver is loaded:&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot; cellspacing=&amp;quot;0&amp;quot; summary=&amp;quot;Camera drivers&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background:#efefef;&amp;quot; align=&amp;quot;center&amp;quot;&lt;br /&gt;
! APF27 || APF6 (kernel 3.19+)&lt;br /&gt;
|---&lt;br /&gt;
|&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
# modprobe mx27_camera&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Then you have to load your camera driver in order for him to &amp;quot;attach&amp;quot; to the CSI one (for example for the OV9653):&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
 # modprobe ov96xx&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
# modprobe -a mx6-camera mipi-csi2 ov5640-mipi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
* On OPOS93, the driver is automatically loaded when the camera is connected.&lt;br /&gt;
* Now it&#039;s up to you to configure your camera with the tools/API the camera driver is offering...&lt;br /&gt;
&lt;br /&gt;
==Test==&lt;br /&gt;
* We have a small SDL/V4L2 app to quickly test that your camera is working properly (you will also need a LCD interface): &#039;&#039;target/demos/camera/capture/&#039;&#039;&lt;br /&gt;
** it may be installed by default on your rootfs depending on your Buildroot defconfig.&lt;br /&gt;
** to launch it (here to have a 640x480 camera image on a LW700 TFT):&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
# capture --width 640 --height 480 --cam_width 640 --cam_height 480&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* To trigger autofocus (APF6 with 3.19+ kernel):&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
# v4l2-ctl -c auto_focus_start=1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* On OPOS93DEV, the pipeline must have the same configuration on every link in the pipeline.&lt;br /&gt;
* Let&#039;s create a script:&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
# cat &amp;lt;&amp;lt; EOF &amp;gt;&amp;gt; setCam.sh &amp;amp;&amp;amp; chmod +x setCam.sh&lt;br /&gt;
&lt;br /&gt;
SOURCE=$3&lt;br /&gt;
FORV4L2=$4&lt;br /&gt;
XL=$1&lt;br /&gt;
YL=$2&lt;br /&gt;
&lt;br /&gt;
if [[$SOURCE == &amp;quot;&amp;quot;]]; then&lt;br /&gt;
        SOURCE=SBGGR10_1X10&lt;br /&gt;
fi&lt;br /&gt;
if [[$FORV4L2 == &amp;quot;&amp;quot;]]; then&lt;br /&gt;
        FORV4L2=BG10&lt;br /&gt;
fi&lt;br /&gt;
if [[$XL == &amp;quot;&amp;quot;]]; then&lt;br /&gt;
        XL=640&lt;br /&gt;
        YL=480&lt;br /&gt;
fi&lt;br /&gt;
&lt;br /&gt;
BAYER=$SOURCE/$XL\x$YL&lt;br /&gt;
echo Setting format to $XL/x$YL in $SOURCE - $FORV4L2&lt;br /&gt;
media-ctl -v -V &amp;quot;&#039;csidev-4ae00000.csi&#039;:0 [fmt:$BAYER field:none]&amp;quot;&lt;br /&gt;
media-ctl -v -V &amp;quot;&#039;csidev-4ae00000.csi&#039;:1 [fmt:$BAYER field:none]&amp;quot;&lt;br /&gt;
media-ctl -v -V &amp;quot;&#039;mxc_isi.0&#039;:0 [fmt:$BAYER field:none]&amp;quot;&lt;br /&gt;
media-ctl -v -V &amp;quot;&#039;mxc_isi.0&#039;:1 [fmt:$BAYER field:none]&amp;quot;&lt;br /&gt;
media-ctl -v -V &amp;quot;&#039;crossbar&#039;:0 [fmt:$BAYER field:none]&amp;quot;&lt;br /&gt;
media-ctl -v -V &amp;quot;&#039;crossbar&#039;:2 [fmt:$BAYER  field:none]&amp;quot;&lt;br /&gt;
media-ctl -v -V &amp;quot;&#039;ov5647 2-0036&#039;:0 [fmt:$BAYER field:none]&amp;quot;&lt;br /&gt;
media-ctl -l &amp;quot;&#039;ov5647 2-0036&#039;:0 -&amp;gt; &#039;csidev-4ae00000.csi&#039;:0[1]&amp;quot;&lt;br /&gt;
v4l2-ctl -d /dev/video0 --set-fmt-video=width=$XL,height=$YL,pixelformat=$FORV4L2&lt;br /&gt;
v4l2-ctl -d /dev/v4l-subdev3 -c exposure=855&lt;br /&gt;
v4l2-ctl -d /dev/v4l-subdev3 -c gain_automatic=1&lt;br /&gt;
v4l2-ctl -d /dev/v4l-subdev3 -c auto_exposure=0&lt;br /&gt;
v4l2-ctl -d /dev/v4l-subdev3 -c white_balance_automatic=1&lt;br /&gt;
&amp;gt; EOF &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Run your script (if you put some arguments, remember the entire pipeline must have the same configuration) and check that all pads have the same format.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
# .setCam.sh&lt;br /&gt;
#  media-ctl -p&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Try streaming to the framebuffer.&lt;br /&gt;
&amp;lt;pre class=&amp;quot;apf&amp;quot;&amp;gt;&lt;br /&gt;
# gst-launch-1.0 --no-position v4l2src ! &#039;video/x-bayer,format=bggr10le,width=640,height=480,bpp=10,framerate=(fraction)10/1&#039; ! bayer2rgbneon reduce-bpp=t show-fps=t silent=t ! fbdevsink device=/dev/fb0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Going further==&lt;br /&gt;
* [[Using the i.MX27 video codec|Using the i.MX27 video codec]]&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
* [http://linux.bytesex.org/v4l2/ Video4Linux]&lt;br /&gt;
&lt;br /&gt;
[[Category:Vision]]&lt;/div&gt;</summary>
		<author><name>SebT</name></author>
	</entry>
</feed>