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. Note: You may need to load a device tree with the correct camera sensor node enabled e.g. for Ixora V1.1A doing setenv fdt_file imx6q-apalis-ixora-v1.1.dtb; saveenv from within U-Boot.

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

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: Note: When running NVIDIA's L4T aka Ubuntu ARM you may need to un-load aka rmmod the nvhost_vi Linux kernel module first which otherwise would conflict with tegra_camera.

modprobe videobuf2-dma-contig
modprobe ov5640
modprobe tegra_camera

Camera preview:

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