Phytec i.MX6UR User manual

PHYTEC Messtechnik GmbH
© PHYTEC Messtechnik GmbH 2015 1 / 10
Support Hotline Europe:: +49 (6131) 9221-31 • http://www.phytec.de
Support Hotline North America: 1-800-278-9913 • http://www.phytec.com
Application Note
How to use phyCAM camera modules with phyCORE-i.MX6UL SBC
Revision History
Version Changes Author Date
A0 Initial Release H. Fendrich 10.04.2017
A1 New Release PD19.1.0 with added VM-011 and VM-009 H. Fendrich 04.07.2019
Content
1Overview .............................................................................................................................................................................................................................................2
2Camera Connectors on the SEGIN - Carrier Boards..........................................................................................................................................................................5
3Change the cameras or camera parameters (YOCTO Linux PD16.1.0 and higher) ..........................................................................................................................6
4Change the cameras or camera parameters (YOCTO Linux PD19.1.0 and higher) ..........................................................................................................................7
5GStreamer function.............................................................................................................................................................................................................................9
6GStreamer function for improved Tearing reduction...........................................................................................................................................................................9
6.1 GStreamer function for improved Tearing reduction (Linux PD16.1.0)......................................................................................................................................9
7De-Bayering (demosaicking) with NEON CoProcessor....................................................................................................................................................................10

PHYTEC Messtechnik GmbH
© PHYTEC Messtechnik GmbH 2015 2 / 10
Support Hotline Europe:: +49 (6131) 9221-31 • http://www.phytec.de
Support Hotline North America: 1-800-278-9913 • http://www.phytec.com
1 Overview
The i.MX6UL Microcontroller supported 1 camera interface (see
figure 1).
figure 1: Block Diagram Camera Interfaces of i.MX6UL Controller (G2 / G3)
On the phyCORE-i.MX6UL the CSI camera path go out as 10-Bit parallel signal.
figure 2: Use of Parallel Camera (CSI)

PHYTEC Messtechnik GmbH
© PHYTEC Messtechnik GmbH 2015 3 / 10
Support Hotline Europe:: +49 (6131) 9221-31 • http://www.phytec.de
Support Hotline North America: 1-800-278-9913 • http://www.phytec.com
On the PHYTEC or customer carrier boards can the interfaces are led out as phyCAM-P (or raw-parallel) see
figure 3 and/or phyCAM-S+ see figure 4. For more information to phyCAM-P/S+ see manual L-748.
figure 3: Block Diagram of an phyCAM-P solution with phyCORE-i.MX6UL (G2 / G3) and the go out on the phyBOARD-SEGIN-i.MX6UL - SBC
On the phyBOARD-Mira baseboard is only the CSI0/IPU#1 camera path (thru a serializer) go out as LVDS signal (see figure 4).
Here you can connect one of the different phyCAM-S(+) camera modules. See the phyCAM-P/-S manual L-748 for more information.
figure 4: Block Diagram of phyCAM-S(+) solution with phyCORE-i.MX6UL (G2 / G3) SBC

PHYTEC Messtechnik GmbH
© PHYTEC Messtechnik GmbH 2015 4 / 10
Support Hotline Europe:: +49 (6131) 9221-31 • http://www.phytec.de
Support Hotline North America: 1-800-278-9913 • http://www.phytec.com
The BSP shipped with the Kit includes already the software drivers for the supported phyCAM camera modules. The drivers are compatible with v4l2. Also
GStreamer scripts are included for the evaluation of the camera modules. If you need more then one camera interface or/and phyCAM-S+ support, please use the
phyFLEX-i.MX6 or phyCORE-i.MX6 Modul.
Note:
The phyBOARD-SEGIN features one CSI interface for phyCAM-P camera modules.
Please find more information about the camera support in the path: …\Documentation\...
The kit version KPB-02013-Alpha-L.A0 is shipped with an i.MX6 controller board which has camera support installed.
The Linux BSP for these kits does support the phyCAM-P camera series from PHYTEC.
ftp://ftp.phytec.de/pub/ImageProcessing/
The table below lists the options:
Hardware Configuration Software Support
phyBOARD Kit phyCAM-P at CSI phyCAM-P at CSI
KPB-02013-Video-L01
yes (VM-010-BW-M12 is included) yes
KPB-02013-Video-L02
Yes (phyCAM-P camera is selectable) yes
KPB-02013-Alpha-
L.A0 yes yes
NM = no mount

PHYTEC Messtechnik GmbH
© PHYTEC Messtechnik GmbH 2015 5 / 10
Support Hotline Europe:: +49 (6131) 9221-31 • http://www.phytec.de
Support Hotline North America: 1-800-278-9913 • http://www.phytec.com
2 Camera Connectors on the SEGIN - Carrier Boards
The development kits for the phyBOARD-SERGIN-i.MX6 contain:
• one carrier board (SERGIN)
• one phyCORE-i.MX6UL modul SOM
The phyCORE-i.MX6UL SOM is tightly soldered with the carrier board.
On the base board SERGIN (PB-02013) we led out the parallel camera interface on the phyCAM-P camera interface standard (see figure 3). The phyCAM-P
interface is support on connector X12 (33pol. FFC). Information’s to phyCAM-P are in the phyCAM-manual (L-748).
figure 5: Camera Interfaces on phyBOARD-SERGIN for the phyCORE-i.MX6UL SOM

PHYTEC Messtechnik GmbH
© PHYTEC Messtechnik GmbH 2015 6 / 10
Support Hotline Europe:: +49 (6131) 9221-31 • http://www.phytec.de
Support Hotline North America: 1-800-278-9913 • http://www.phytec.com
3 Change the cameras or camera parameters (YOCTO Linux PD16.1.0 and higher)
At the moment is only the VM-010 camera series supported. The driver is compiled in the BSP and will be loaded at the boot sequence.
You can only change the color type of the camera between "color" and "monochrome".
If you need a higher resolution or more than one camera, we recommend using a phyCORE-i.MX6 or phyFLEX-i.MX6 SOM.
For more information see on FTP:
ftp://ftp.phytec.de/pub/ImageProcessing/phyBOARD-Segin-i.MX6UL_linux_PD17.2.0/
The configuration in the config-expansions file must match with the camera models that are connected to the camera interfaces.
Note that model, interface type and I²C-addresses must be set correctly. Otherwise the camera(s) are not working.
Please check, if the correct camera model is set in the config file. If not, please follow the steps below to set the appropriate configuration.
Changing the setting of the camera-bootarg parameters
Depending on the camera there has to be set a corresponding entry in the bootloader Barebox.
At the moment you can only change between the -COL (color) and –BW (monochrome) versions of VM-010.
To change the device-tree use the Barebox environment:
- type 'nv linux.bootargs.mt9v022="mt9v022.sensor_type=color"' <enter>, for color version
- type 'nv linux.bootargs.mt9v022="mt9v022.sensor_type=mono"' <enter>, for monochrome version
- type 'saveenv' <enter>
- type 'reset' <enter>
After login, change into the directory: \gstreamer_examples\..
cd gstreamer_examples <ENTER>.
Now you can start working with the GStreamer demo-scripts. Detailed information about the GStreamer examples can be found in the phyCAM-Manual L-748.

PHYTEC Messtechnik GmbH
© PHYTEC Messtechnik GmbH 2015 7 / 10
Support Hotline Europe:: +49 (6131) 9221-31 • http://www.phytec.de
Support Hotline North America: 1-800-278-9913 • http://www.phytec.com
Hardware Configuration Bootarg Parameters
phyCAM camera model
(part number) connected to csi_cam_bus_type csi_cam_i2c_address
Bootarg settings for default I²C-address
(default jumper on camera and boards)
VM-010-BW (-M12 / -H) X12 on SERGIN board phyCAM-P 0x48 default (0x4C, 0x58, 0x5C possible) nv linux.bootargs.mt9v022="mt9v022.sensor_type=color”
VM-010-COL (-M12 / -H) X12 on SERGIN board phyCAM-P 0x48 default (0x4C, 0x58, 0x5C possible) nv linux.bootargs.mt9v022="mt9v022.sensor_type=mono”
Notes:
•csi_cam address must be identical to the I²C-address of the corresponding camera. I²C addresses of the camera are set by hardware configuration (jumper
setting on the camera and / or on the baseboard / mapper board. Please refer to the phyCAM-manual L-748 and the hardware manual of the kit. For change
the I²C-Address in the BSP the device-tree have to change and the BSP you have to compile the BSP new.
4 Change the cameras or camera parameters (YOCTO Linux PD19.1.0 and higher)
At the moment are the VM-010, VM-011 and VM-009 camera series supported. The drivers is compiled in the BSP and will be loaded at the boot sequence.
You can change the cameras and the color type of the camera between "color" and "monochrome".
If you need more processor power or more than one camera, we recommend using a phyCORE-i.MX6 or phyFLEX-i.MX6 SOM.
For more information see on FTP:
ftp://ftp.phytec.de/pub/ImageProcessing/phyBOARD-Segin-i.MX6UL_linux_PD19.1.0/
The configuration in the config-expansions file must match with the camera models that are connected to the camera interfaces.
Note that model, interface type and I²C-addresses must be set correctly. Otherwise the camera(s) are not working.
Please check, if the correct camera model is set in the config file. If not, please follow the steps below to set the appropriate configuration.
Changing the setting of the config-expansions parameters
To change the config-file (config-expansions), use the Barebox environment: Use a terminal program e.g. "Putty".
•'cd env' <enter>
•'edit config-expansions' <enter>
The following settings in config-expansions - file are necessary:
<cam_type[color_format]>

PHYTEC Messtechnik GmbH
© PHYTEC Messtechnik GmbH 2015 8 / 10
Support Hotline Europe:: +49 (6131) 9221-31 • http://www.phytec.de
Support Hotline North America: 1-800-278-9913 • http://www.phytec.com
•cam_type[color_format] = [VM-010-BW, VM-010-COL, VM-011-BW, VM-011-COL, VM-009]
Example: VM-010-COL:
[. /env/expansions/imx6ul-phytec-vm010-col]
The parameters for the phyCAM – modules are shown in the table below.
After changing the settings with the editor:
•close the editor (CTRL D)
•type 'saveenv' <enter> to save
•restart PHYTEC module
After login, change into the directory: \gstreamer_examples\..
cd gstreamer_examples <ENTER>.
Now you can start working with the GStreamer demo-scripts. Detailed information about the GStreamer examples can be found in the phyCAM-Manual L-748.
Hardware Configuration Bootarg Parameters
phyCAM camera model
(part number) connected to csi_cam_bus_type csi_cam_i2c_address
Bootarg settings for default I²C-address
(default jumper on camera and boards)
VM-010-BW (-M12 / -H) X12 on SEGIN board phyCAM-P 0x48 default (0x4C, 0x58, 0x5C possible) . /env/expansions/imx6ul-phytec-vm010-bw
VM-010-COL (-M12 / -H) X12 on SEGIN board phyCAM-P 0x48 default (0x4C, 0x58, 0x5C possible) . /env/expansions/imx6ul-phytec-vm010-col
VM-011-BW (-M12 / -H) X12 on SEGIN board phyCAM-P 0x48 default (0x5D possible) . /env/expansions/imx6ul-phytec-vm011-bw
VM-011-COL (-M12 / -H) X12 on SEGIN board phyCAM-P 0x48 default (0x5D possible) . /env/expansions/imx6ul-phytec-vm011-col
VM-009 (-M12 / -H) X12 on SEGIN board phyCAM-P 0x48 default (0x5D possible) . /env/expansions/imx6ul-phytec-vm009
Notes:
•csi_cam address must be identical to the I²C-address of the corresponding camera. I²C addresses of the camera are set by hardware configuration (jumper
setting on the camera and / or on the baseboard / mapper board. Please refer to the phyCAM-manual L-748 and the hardware manual of the kit. For change
the I²C-Address in the BSP the device-tree have to change and the BSP you have to compile the BSP new.

PHYTEC Messtechnik GmbH
© PHYTEC Messtechnik GmbH 2015 9 / 10
Support Hotline Europe:: +49 (6131) 9221-31 • http://www.phytec.de
Support Hotline North America: 1-800-278-9913 • http://www.phytec.com
5 GStreamer function
After login, change into the directory: \gstreamer_examples\..
cd gstreamer_examples <ENTER>.
Now you can start working with the GStreamer demo-scripts.
Information’s about the GStreamer examples are in the notes in the scripts and can be found in the phyCAM-Manual L-748.
6 GStreamer function for improved Tearing reduction
Tearing is a visual artifact in video display where the display image shows information from two or more frames in a single screen draw.
It appears as a horizontal border or line. The image part beyond the line seems to be shifted horizontally when the image content or the camera is moved.
The tearing line(s) usually move(s) vertically across the image.
The artifact occurs when the camera framerate differs from the display frame or the camera readout cycle is not in sync with the display's refresh.
Definition and background information about the tearing effect can be found in http://en.wikipedia.org/wiki/Screen_tearing.
The Freescale i.MX-6 processor contains an anti-tearing mechanism in the IPU unit, which can reduce the tearing effect.
However, since - depending on camera settings and camera model - the frame rate might be very different from the display’s refresh rate, tearing effects might still
be visible even if the anti-tearing mechanism is active. For applications that are intended to display live camera images on the display, additional measures should
be considered to obtain a perfect image quality. This measures can include frame rate control (trimming the camera frame rate to the display’s refresh rate), multi-
buffering of the camera image etc.
We recommend to activate the anti-tearing mechanism of the i.MX-6 when live camera images are shown on the display. For evaluation purposes with the
development kits, Phytec added GStreamer examples, that use a different fbsink – function, that activates the anti-tearing mechanism.
6.1 GStreamer function for improved Tearing reduction (Linux PD16.1.0)
From PD16.1.0 up to PD17.1.1 the GStreamer contains the " imxpxpvideosink use-vsync=tru" plugin.
This plugin reduce the tearing. Most of the Phytec GStreamer example scripts use this plugin. Please show the scripts in path ../gstreamer_examples/.. .
For more information to "imxpxpvideosink" parameters type:
- gst-inspect-1.0 imxpxpvideosink

PHYTEC Messtechnik GmbH
© PHYTEC Messtechnik GmbH 2015 10 / 10
Support Hotline Europe:: +49 (6131) 9221-31 • http://www.phytec.de
Support Hotline North America: 1-800-278-9913 • http://www.phytec.com
7 De-Bayering (demosaicking) with NEON CoProcessor
Most of CMOS color chips provide the image in the bayer mosaicing (bayer raw) format. For get a color image in RGB format is it necessary to convert the bayer raw
image.
- https://en.wikipedia.org/wiki/Bayer_filter
- https://de.wikipedia.org/wiki/Bayer-Sensor
There are exist different algorithm for converting.
- https://en.wikipedia.org/wiki/Demosaicing
If the microprocessor does not include debayering hardware, have to do the converting via software. For this you need additional processing power and the
framerate goes down. It is better to use the NEON coprocessor of the i.MX6. For this support PHYTEC a special function.
It is present as GStreamer plugin "bayer2rgbneon" and in sources for use in an own C-program. We support a simple bilinear algorithm.
For use in GStreamer take "bayer2rgbneon" plugin. For more information to " bayer2rgbneon" parameters type:
- gst-inspect-1.0 bayer2rgbneon
Table of contents
Other Phytec Microcontroller manuals

Phytec
Phytec phyCORE-AM335x Programming manual

Phytec
Phytec miniMODUL-537 User manual

Phytec
Phytec IoT-Enablement-Kit 1 User manual

Phytec
Phytec Linux-Kit phyCARD-M Programming manual

Phytec
Phytec nanoModul-164 Programming manual

Phytec
Phytec SYS TEC ELECTRONIC CANopen Chip164 Programming manual

Phytec
Phytec phyCORE-XScale/PXA255 Installation and operating instructions

Phytec
Phytec phyCORE-LPC3250 Programming manual

Phytec
Phytec phyCORE-167CS User manual

Phytec
Phytec phyCORE-LPC3250 Programming manual