Project

General

Profile

MitySOM-AM62 CSI-2 Camera Capture

The AM62x is able to stream image data from MIPI/CSI-2 cameras capable of generating images with YUV or RGB colorspace output. The AM62x does not include hardware based debayering / Image Signal Processing (ISP) accelerators.

This example outlines examples streaming or capturing image data from a couple of off-the-shelf cameras.

The connector interface on the MitySOM-AM62 Development kit is intended to be compatible with the Raspberry Pi zero 22-pin 0.5 mm pitch interface. Connections for MIPI cameras utilizing the Raspberry Pi 15 pin 1.0mm pitch interface can be made with a 15-pin to 22-pin flex cable adaptor, such as the Arducam Raspberry Pi Camera Cable.

Using a Digilent PCAM 5C Camera

The Digilent PCAM 5C camera is a 5MP camera based on the ov5640 sensor from Omni-Vision.

Connect the camera.

The pictures below show the connections for the camera to the development kit using the Arducam adapter cable. Note that the conductors must be on the top side of the MitySOM-AM62 evaluation board interface.

Configure to use the MitySOM-AM62 Development Kit OV5640 Overlay

In uBoot, update the "name_overlays" variable prior to booting:

=> setenv name_overlays k3-am625-mitysom-ov5640.dtbo
=> saveenv
=> boot

Reset the Weston/Wayland (disable the example HMI demo)

root@mitysom-0am62x:~# /etc/init.d/weston restart

Streaming Examples

640x480, 30 Hz

root@mitysom-0am62x:~# media-ctl --set-v4l2 "'ov5640 1-003c':0 [fmt:UYVY8_1X16/640x480@1/30 field:none]" 
root@mitysom-0am62x:~# gst-launch-1.0 v4l2src device="/dev/video0" ! video/x-raw , width=1024, height=768, framerate=30/1, format=UYVY ! waylandsink

1024x768, 30 Hz

root@mitysom-0am62x:~# media-ctl --set-v4l2 "'ov5640 1-003c':0 [fmt:UYVY8_1X16/1024x768@1/30 field:none]" 
root@mitysom-0am62x:~# gst-launch-1.0 v4l2src device="/dev/video0" ! video/x-raw , width=1024, height=768, framerate=30/1, format=UYVY ! waylandsink

1920x1024, 15 Hz

root@mitysom-0am62x:~# media-ctl --set-v4l2 "'ov5640 1-003c':0 [fmt:UYVY8_1X16/1920x1024@1/15 field:none]" 
root@mitysom-0am62x:~# gst-launch-1.0 v4l2src device="/dev/video0" ! video/x-raw , width=1920, height=1024, framerate=15/1, format=UYVY ! waylandsink

Using controls

The OV5640 and driver does have V4L2 controls to allow generation of test patterns as well as flipping X and Y on the output:

root@mitysom-am62x:~# v4l2-ctl -L -d /dev/v4l-subdev2 

User Controls

                       contrast 0x00980901 (int)    : min=0 max=255 step=1 default=0 value=0 flags=slider
                     saturation 0x00980902 (int)    : min=0 max=255 step=1 default=64 value=64 flags=slider
                            hue 0x00980903 (int)    : min=0 max=359 step=1 default=0 value=0 flags=slider
        white_balance_automatic 0x0098090c (bool)   : default=1 value=1 flags=update
                    red_balance 0x0098090e (int)    : min=0 max=4095 step=1 default=0 value=0 flags=inactive, slider
                   blue_balance 0x0098090f (int)    : min=0 max=4095 step=1 default=0 value=0 flags=inactive, slider
error 121 getting ctrl Exposure
                 gain_automatic 0x00980912 (bool)   : default=1 value=1 flags=update
                horizontal_flip 0x00980914 (bool)   : default=0 value=0
                  vertical_flip 0x00980915 (bool)   : default=0 value=0
           power_line_frequency 0x00980918 (menu)   : min=0 max=3 default=1 value=1 (50 Hz)
                                0: Disabled
                                1: 50 Hz
                                2: 60 Hz
                                3: Auto

Camera Controls

error 121 getting ext_ctrl Auto Exposure

Image Source Controls

              vertical_blanking 0x009e0901 (int)    : min=24 max=2895 step=1 default=600 value=600
            horizontal_blanking 0x009e0902 (int)    : min=1256 max=1256 step=1 default=1256 value=1256 flags=read-only
error 121 getting ext_ctrl Analogue Gain

Image Processing Controls

                 link_frequency 0x009f0901 (intmenu): min=0 max=22 default=13 value=13 (384000000 0x16e36000) flags=read-only
                                0: 992000000 (0x3b20b800)
                                1: 888000000 (0x34edce00)
                                2: 768000000 (0x2dc6c000)
                                3: 744000000 (0x2c588a00)
                                4: 672000000 (0x280de800)
                                5: 672000000 (0x280de800)
                                6: 592000000 (0x23493400)
                                7: 592000000 (0x23493400)
                                8: 576000000 (0x22551000)
                                9: 576000000 (0x22551000)
                                10: 496000000 (0x1d905c00)
                                11: 496000000 (0x1d905c00)
                                12: 384000000 (0x16e36000)
                                13: 384000000 (0x16e36000)
                                14: 384000000 (0x16e36000)
                                15: 336000000 (0x1406f400)
                                16: 296000000 (0x11a49a00)
                                17: 288000000 (0x112a8800)
                                18: 248000000 (0xec82e00)
                                19: 192000000 (0xb71b000)
                                20: 192000000 (0xb71b000)
                                21: 192000000 (0xb71b000)
                                22: 96000000 (0x5b8d800)
                     pixel_rate 0x009f0902 (int64)  : min=48000000 max=168000000 step=1 default=48000000 value=48000000 flags=read-only
                   test_pattern 0x009f0903 (menu)   : min=0 max=4 default=0 value=0 (Disabled)
                                0: Disabled
                                1: Color bars
                                2: Color bars w/ rolling bar
                                3: Color squares
                                4: Color squares w/ rolling bar
root@mitysom-am62x:~#  v4l2-ctl --set-ctrl=test_pattern=3 -d /dev/v4l-subdev2
root@mitysom-am62x:~#  v4l2-ctl --set-ctrl=horizontal_flip=1 -d /dev/v4l-subdev2

Using a Raspberry Pi-2 Camera

The Raspberry Pi-2 camera is an 8MP camera based on the imx219 sensor from Sony. The imx219 only presents data as raw pixels (bayer pattern), so the camera cannot be directly streamed to the display as there is no ISP on the AM62x platform to perform the colorspace conversion. However, you can still capture the image to memory and perform processor actions on the image using the ARM Cortex-A53 block:



	

Go to top
Add picture from clipboard (Maximum size: 1 GB)