Camera

The Camera Serial Interface (CSI) is a specification of the Mobile Industry Processor Interface (MIPI) Alliance. It defines an interface between a camera and a host processor. The phyCORE-AM62x has one CSI camera connection on the back of the carrier board, at X28. This guide will show you how to connect and take pictures with a MIPI CSI-2 camera module (VM-016 phyCAM-M). To learn more information about the phyCORE-AM62x CSI/Camera interface, please see sections 8 and 8.3 in the Hardware Manual.

phyCORE-AM62x Camera

Requirements

Setting Up the Camera

  • With the board powered off, connect the phyCAM-M module to the camera connector (X28) on the carrier board.

    1. Open the X28 connector by pulling the black tab backwards toward the center of the carrier board.

    2. Insert the ribbon cable into the connector, with the blue tape facing outward.

    3. Once the ribbon cable has been seated into the connector, pull the black tab back towards it’s closed position. You should hear a small click when the connector has completely closed.

  • Power on the development kit and stop in U-boot. Load the device tree overlay required for the parallel camera interface and then boot the board.

Target (U-boot)
setenv overlays k3-am62-phyboard-lyra-vm016-mipi.dtbo
boot

Note

For more information about overlays see chapter Configuring the Bootloader.

Taking a Picture

  • To capture a JPG picture named “smile.jpg”, use the following gstreamer pipeline command.

Target (Linux)
media-ctl -V '"ar0144 1-0010":0 [fmt:SGRBG8_1X8/1280x800]'
gst-launch-1.0 v4l2src num-buffers=5 device=/dev/video0 ! video/x-bayer,format=grbg,depth=8,width=1280,height=800 ! bayer2rgb ! videoconvert ! jpegenc ! multifilesink location=smile.jpg

Note

“ar0144” refers to the CMOS digital image sensor with the pixel array of 1280H x 800V being used to capture images.

“1-0010” refers to the I2C device being used. In this case I2C1 device is being utilized.

Target (Expected Output)
 Setting pipeline to PAUSED ...
     Pipeline is live and does not need PREROLL ...
     Setting pipeline to PLAYING ...
     New clock: GstSystemClock
     Got EOS from element "pipeline0".
     Execution ended after 0:00:02.443544000
     Setting pipeline to NULL ...
     Freeing pipeline ...

Viewing Picture

This example will use the Secure Copy Protocol (SCP), which requires a network connection. Discover more mediums that can assist in copying files by following the guide Copying Files to the Device.

Viewing via SCP

  • Use a local network and copy the file from the development kit to your host machine (Ubuntu or Windows).

    1. Connect the development kit to your local network using either ethernet port.

    2. Confirm the development kit’s ethernet IP address (DHCP). For more information on how to change the from a static IP address to a DHCP address, see the Ethernet interface guide.

      Target (Linux)
      ip addr
      
    1. Transfer the image via Windows Command Prompt or Linux terminal.

      Host (Ubuntu or Windows)
      sudo scp root@<devkit_ip_address>:/root/smile.jpg ./Downloads/
      
  • Open your host machine’s Downloads folder. You should see an image named “smile.jpg”.