Search by Tags

CSI Camera Module 5MP OV5640 (Linux)

 
Applicable for

Compare with Revision


Subscribe for this article updates

Overview

This article talks about the Toradex CSI Camera Module 5MP OV5640 plugged into an Apalis Evaluation Board (via FFC receptacle available on future versions of our module type specific Apalis mezzanine boards) or the new Ixora Carrier Board V1.1A. It is connected via the MIPI Camera Serial Interface 2 (MIPI CSI-2).

Apalis iMX6

On Apalis iMX6 the kernel modules are included out-of-the-box and are loaded by default.

Camera preview:

gst-launch-1.0 -v imxv4l2src device=/dev/video1 ! capsfilter caps="video/x-raw, width=1280, height=720, framerate=30/1" ! queue ! imxv4l2sink
gst-launch-1.0 -v imxv4l2src device=/dev/video1 ! capsfilter caps="video/x-raw, width=1280, height=720, framerate=30/1" ! queue ! imxv4l2sink

Apalis T30

Assert reset on the OV5640 camera sensor:

echo low > /sys/class/gpio/gpio146/direction

Power-up OV5640 camera sensor:

echo low > /sys/class/gpio/gpio147/direction

Release reset on the OV5640 camera sensor:

echo high > /sys/class/gpio/gpio146/direction

On Apalis T30 the kernel modules are included out-of-the-box. Load camera related kernel modules in this order:

modprobe videobuf2-memops
modprobe videobuf2-dma-nvmap
modprobe ov5640
modprobe tegra_v4l2_camera

Camera preview:

gst-launch -e v4l2src device="/dev/video0" ! 'video/x-raw-yuv, width=(int)640, height=(int)480, format=(fourcc)YUY2' ! nvvidconv ! 'video/x-nvrm-yuv, format=(fourcc)I420' ! nvxvimagesink
gst-launch -e v4l2src device="/dev/video0" ! 'video/x-raw-yuv, width=(int)1920, height=(int)1088, format=(fourcc)YUY2' ! nvvidconv ! 'video/x-nvrm-yuv, format=(fourcc)I420' ! nvxvimagesink

Apalis TK1

Assert reset on the OV5640 camera sensor:

echo 250 > /sys/class/gpio/export
echo low > /sys/class/gpio/gpio250/direction

Power-up OV5640 camera sensor:

echo 248 > /sys/class/gpio/export
echo low > /sys/class/gpio/gpio248/direction

Release reset on the OV5640 camera sensor:

echo high > /sys/class/gpio/gpio250/direction

On Apalis TK1 the kernel modules are included out-of-the-box. Load camera related kernel modules in this order:

modprobe videobuf2-dma-contig
modprobe ov5640
modprobe tegra_camera

Camera preview: Note: Starting with our BSP 2.7b4 we recommend using gstreamer 0.10 which is much better supported by NVIDIA on TK1.

gst-launch-0.10 v4l2src queue-size=1 ! 'video/x-raw-yuv,format=(fourcc)UYVY,width=640,height=480' ! xvimagesink
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,format={UYVY},width=640,height=480' ! xvimagesink